小编sno*_*wvy的帖子

使用自制程序安装 AWS CLI 时出现错误 [SSL: CERTIFICATE_VERIFY_FAILED]

我的系统是 M1 Mac,配备 macOS 12.3.1,并通过自制软件安装 aws cli,当尝试运行时,aws s3 ls出现错误 SSL validation failed for https://s3.{awsregion}.amazonaws.com/ [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

我检查了 python3 SSL 路径,命令python3 -c 'import ssl; print(ssl.get_default_verify_paths())' 结果是DefaultVerifyPaths(cafile='/opt/homebrew/etc/openssl@1.1/cert.pem', capath=None, openssl_cafile_env='SSL_CERT_FILE', openssl_cafile='/opt/homebrew/etc/openssl@1.1/cert.pem', openssl_capath_env='SSL_CERT_DIR', openssl_capath='/opt/homebrew/etc/openssl@1.1/certs')

这意味着它使用brew install版本的openssl@1.1并且python3也使用brew install版本python@3.9位置是 /opt/homebrew/bin/python3

我尝试重新安装 awscli、openssl@1.1 和 python@3.9,然后也尝试

  1. 从brew中卸载Python3
  2. 使用 Python 网站的安装程序安装 Python
  3. 在Python文件夹中执行Install Certificates.command
  4. 卸载Python
  5. 从brew安装python@3.9

也给了我同样的错误。

这里有关于我的系统的一些信息

  • M1 Mac - MacOS 12.3.1
  • Python3-brew python@3.9 (3.9.12)
  • OpenSSL - 酿造 openssl@1.1 (1.1.1n)
  • AWS CLI-brew awscli (2.6.0) …

python macos ssl homebrew aws-cli

2
推荐指数
1
解决办法
3081
查看次数

标签 统计

aws-cli ×1

homebrew ×1

macos ×1

python ×1

ssl ×1