2017-06-03 63 views
0

我使用下面的生成:斷開使用HTTPS與Nodemcu

NodeMCU custom build by frightanic.com 
.branch: master 
.commit: c8ac5cfb912ff206b03dd7c60ffbb2dafb83fe5e 
.SSL: true 
.modules: file,gpio,http,i2c,net,node,spi,tmr,uart,wifi,tls 
build .built on: 2017-06-03 03:24 
powered by Lua 5.1.4 on SDK 2.1.0(116b762) 

使用HTTP模塊,我可以成功地使get調用:

> http.get("http://httpbin.org/ip", nil, function(code, data) 
if (code < 0) then 
    print("HTTP request failed") 
else 
    print(code, data) 
end 
end)>> >> 
> 200 { 
"origin": "61.69.19.186" 
} 

使用HTTPS使等效調用導致超時:

http.get("https://httpbin.org/ip", nil, function(code, data) 
if (code < 0) then 
    print("HTTP request failed") 
else 
    print(code, data) 
end 
end)>> >> 

與控制檯上顯示以下信息:

HTTP client: Disconnected with error: 9 
HTTP client: Connection timeout 

從大約一年前一對夫婦的其他類似的問題談了網模塊,並呼籲httpbin.org需要SSL實現的特定版本所需的修復:

HTTPS (SSL) get request with NodeMCU

HTTPS get requests with NodeMCU and ESP8266

構建今天的創建與mbedTLS的TLS/SSL支持。

回答

0

而不是在評論中,我將此作爲「答案」提供,以便問題可在事後關閉(幫助那些在此處觀看nodemcu標籤的人)。

這是一個在https://github.com/nodemcu/nodemcu-firmware/issues/1707跟蹤的已知問題。 Espressif SDK升級2.0版建立安全的HTTP連接似乎有些問題。

+0

謝謝你的擡頭。看起來像這個錯誤也出現在使用SDK 1.5.4.1的早期固件中,我下載了它來檢查那是:NodeMCU由frightanic.com自定義構建 .branch:1.5.4.1-final .commit:1885a30bd99aec338479aaed77c992dfd97fa8e2 .SSL:true 。模塊:文件,gpio,http,i2c,網絡,節點,spi,tmr,uart,wifi,tls build .built on:2017-06-07 06:01 由Lua 5.1.4在SDK 1.5上提供支持。 4.1(39cb9a32)結果(如果有): 客戶端握手開始。 客戶端握手失敗 錯誤:SSL錯誤80 – mhaselup

+0

不,這是別的。當最後一次檢查httpbin.org使用的是2.0之前的Espressif SDK(axTLS vs. mbed TLS)不支持的SNI證書。此外,2.0之前版本僅支持TLS 1.1,只有四個密碼套件。 –