aws cli 中的 SSL CERTIFICATE_VERIFY_FAILED [英] SSL CERTIFICATE_VERIFY_FAILED in aws cli

查看:57
本文介绍了aws cli 中的 SSL CERTIFICATE_VERIFY_FAILED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 AWS CLI 在 Windows 服务器 2007 32 位上.

I installed AWS CLI on the Windows server 2007 32bit.

aws --version
aws-cli/1.8.8 Python/2.7.9 Windows/2008Server 

我使用密钥配置 aws cli

一旦我运行以下命令来测试 AWS S3,我就会收到此 SSL 错误:

Once I run below command to test AWS S3, I get this SSL error:

aws s3 ls
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)

请帮助摆脱这个基本错误.

Please help to get rid of this basic error.

推荐答案

如果要使用 SSL 而不必指定 --no-verify-ssl 选项,则需要设置AWS_CA_BUNDLE 环境变量.例如来自 PowerShell:

If you want to use SSL and not have to specify the --no-verify-ssl option, then you need to set the AWS_CA_BUNDLE environment variable. e.g from PowerShell:

setx AWS_CA_BUNDLE "C:UsersUserXDocumentsRootCert.pem"

PEM 文件是您尝试连接的 AWS 终端节点的根证书的保存副本.要生成它,首先以 DER 格式导出证书(有关如何执行此操作的详细信息,请参阅 此处).然后运行以下命令转换为PEM格式:

The PEM file is a saved copy of the root certificate for the AWS endpoint you are trying to connect to. To generate it, first export the certificate in DER format (For details on how to do this, see here). Then run the following command to convert to the PEM format:

openssl x509 -inform der -in "C:UsersUserXDocumentsRootCert.der" -out RootCert.pem

如果您使用的是 Powershell 而不是 bash,那么您需要先安装 openssl.

If you are using Powershell and not bash, then you will need to first install openssl.

有关 AWS CLI 支持的环境变量的完整列表,请参阅 这里

For a full list of environment variables supported by the AWS CLI, see here

这篇关于aws cli 中的 SSL CERTIFICATE_VERIFY_FAILED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆