0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【AWS】ACMで証明書のインポート時にエラー

Posted at

環境

> aws --version
aws-cli/2.15.0 Python/3.11.6 Windows/10 exe/AMD64 prompt/off

事象

AWS Certificate Manager(ACM)にて外部で発行した証明書をCLIでインポートするため以下のコマンドを実行したところ、エラーが発生しました。

# 実行コマンド
> aws acm import-certificate
    --certificate file://xxxx.cer
    --private-key file://xxxx.key
    --certificate-chain file://xxxx.txt

# 発生したエラー
An error occurred (ValidationException) when calling the ImportCertificate operation: 
The certificate field contains more than one certificate. 
You can specify only one certificate in this field.

対処方法

ファイルの指定時に「file://」ではなく「fileb://」とすることで正常にインポートできました。

# 実行コマンド
> aws acm import-certificate
    --certificate fileb://xxxx.cer
    --private-key fileb://xxxx.key
    --certificate-chain fileb://xxxx.txt

詳細

「file://」は、base64エンコードされたテキスト情報を渡す際に使用するようです。

参考

Command line options in the AWS CLI

真のバイナリコンテンツを渡すには、コンテンツをファイルに置き、ファイルのパスと名前をパラメータの値として fileb:// プレフィックスを付けて指定します。ファイルに含まれる base64 エンコードされたテキストを渡すには、ファイルのパスと名前をパラメータの値として file:// プレフィックスを付けて指定します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?