homebrew - 如何使用 AWS CLI IoT API 修复 OpenSSL 错误?

标签 homebrew aws-cli

我正在尝试在 Mac 上运行 AWS CLI。我正在尝试使用 iot-data API 读取/写入影子状态。该命令实际上工作正常,但每次都会引发 OpenSSL/TLS 错误。

$ aws iot-data get-thing-shadow --thing-name "my-thing-20160209" my-thing-20160209.json

/usr/local/Cellar/awscli/1.10.1/libexec/vendor/lib/python2.7/site-packages/botocore/handlers.py:574: UnsupportedTLSVersionWarning: Currently installed openssl version: OpenSSL 0.9.8zg 14 July 2015 does not support TLS 1.2, which is required for use of iot-data. Please use python installed with openssl version 1.0.1 or higher.
  UnsupportedTLSVersionWarning

这是 AWS 版本。
aws-cli/1.10.1 Python/2.7.10 Darwin/14.5.0 botocore/1.3.23
如您所见,我使用 Homebrew 安装所有内容。 OpenSSL 和 Python 已正确链接。我在我的系统上找不到任何引用 OpenSSL 0.9.8zg 的内容,并且 Python 加载了正确的 OpenSSL 版本。
$ python -c 'import ssl; print ssl.OPENSSL_VERSION'
OpenSSL 1.0.2f  28 Jan 2016

有迹象表明其他因素可能会触发错误:
https://forums.aws.amazon.com/thread.jspa?messageID=690051#690051

但是,由于我实际上可以检索影子状态,因此错误一定是由于其他原因。

任何想法可能导致此错误?

更新:2016-09-15 包括 Python 信息
$ head $(which aws)
#!/bin/bash
PYTHONPATH="/usr/local/Cellar/awscli/1.10.51/libexec/lib/python2.7/site-packages:/usr/local/Cellar/awscli/1.10.51/libexec/vendor/lib/python2.7/site-packages" exec "/usr/local/Cellar/awscli/1.10.51/libexec/bin/aws" "$@"

最佳答案

由于 OS X 有自己的 python 和 openssl 库,因此 awscli 似乎引用它们而不是您的 brew 版本。我猜想 (a) home-brew 的符号链接(symbolic link)真的不正确,或者 (b) home-brew python 没有绑定(bind)到 brewed openssl 版本(所以 awscli 拿起系统 openssl lib,但是当你手动导入库,您将获得更多最新版本)。

我会更新 OpenSSL,强制其链接并重新安装 python,如下所示:

brew update
brew install openssl
brew link openssl --force 

brew install python --with-brewed-openssl

关于homebrew - 如何使用 AWS CLI IoT API 修复 OpenSSL 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35473033/

相关文章:

c - 在 pkg-config 搜索路径中找不到包检查

bash - 无法在 macOS 上修改/etc/shells 以包含 brew 安装的 bash 版本

c++ - macOS fatal error : sys/_types/_int8_t. h : No such file or directory #include <sys/_types/_int8_t. h>

amazon-web-services - 如何将文件从一个 AWS 账户复制到另一个 AWS 账户

amazon-web-services - EC2 Spot 实例容量池

amazon-web-services - 在 env 中找到部分凭据,缺少 : AWS_SECRET_ACCESS_KEY

postgresql - brew uninstall OSX 后完全删除 postgres

java - 带有 Zookeeper 的 Kafka 3.5.7 崩溃 NoSuchMethodError : java. nio.ByteBuffer.flip()

amazon-web-services - 如何在 aws ssm get-parameters-by-path 中正确指定路径?

python - MAC 上的 AWS CLI 指向错误的 Python 版本