使用ec2-upload-bundle时,Amazon EC2/S3"自签名证书"SSL失败

hwj*_*wjp 2 curl amazon-web-services

在尝试将AMI捆绑包上传到S3时,有没有其他人看到此错误?

Error talking to S3: Curl.Error(60): SSL certificate problem: self signed certificate in certificate chain
Run Code Online (Sandbox Code Playgroud)

刚刚开始发生,周五工作正常.使用PHP工具包时报告了一些类似的问题 -

但我不认为它们和我的问题完全一样.我的桶名中没有使用圆点......

更多追溯:

Created image.part.174
Created image.part.175
Generating digests for each part...
Digests generated.
Unable to read instance meta-data for ramdisk-id
Unable to read instance meta-data for product-codes
Creating bundle manifest...
ec2-bundle-vol complete.
ERROR: Error talking to S3: Curl.Error(60): SSL certificate problem: self signed certificate in certificate chain
Run Code Online (Sandbox Code Playgroud)

是否有某种环境变量我可以用来(临时)切换SSL验证以便在运行之前运行ec2-upload-bundle

ejd*_*sen 5

看起来您可能正在ec2-upload-bundle使用先前打包使用的AMI 运行ec2-bundle-vol,这会在创建系统映像之前删除系统上的大量不同文件(以避免敏感信息进入映像).来自AWS文档:

默认情况下,捆绑包进程会排除可能包含敏感信息的文件.这些文件包括*.sw,*.swo,*.swp,*.pem,*.priv ,*id_rsa*,**id_dsa的`*.gpg,*.jks,*/.ssh/authorized_keys,和*/.bash_history.要包含所有这些文件,请使用该--no-filter选项.要包含其中一些文件,请使用--include option.

在这种情况下,您的系统上的根证书数据库似乎搞砸了.在Ubuntu(可能还有其他发行版)上,运行此命令会重新加载系统上的根证书,从而解决了以下问题:

update-ca-certificates
Run Code Online (Sandbox Code Playgroud)