2016-02-18 24 views
6

我試圖在Mac上運行AWS CLI。我正在嘗試使用iot-data API讀取/寫入陰影狀態。該命令實際上工作正常,但每次都會引發OpenSSL/TLS錯誤。如何使用AWS CLI IoT API修復OpenSSL錯誤?

$ 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

正如你所看到的,我用自制安裝所有。 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年9月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" "[email protected]" 
+0

的Python解釋器您使用?例如。頭$(其中aws) – vielmetti

回答

1

因爲OS X有其自己的Python和OpenSSL LIB,看來awscli被引用他們,而不是你煮的版本。我猜想(a)家釀的sym鏈接實際上是不正確的,或者(b)家釀brew並不與釀造的openssl版本相關聯(所以awscli拿起系統openssl lib,但是當你手動導入庫,你會得到更新的版本)。

我會更新OpenSSL,迫使其鏈接,像這樣重新安裝python:

brew update 
brew install openssl 
brew link openssl --force 

brew install python --with-brewed-openssl 
+0

我不記得,如果我試過這個,所以我正在經歷的步驟。現在,我得到的錯誤:「警告:拒絕鏈接:openssl 鏈接桶只有openssl意味着你可能最終鏈接對不安全......」看起來我可能需要定義一些變量https:// github.com/dotnet/cli/issues/3964 – jedatu

+0

嗯,這很尷尬。你有沒有考慮過踢球 - 用pip安裝awscli? – gregory