【发布时间】:2017-11-04 12:58:56
【问题描述】:
我正在使用以下构建:
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
大约一年前的其他几个类似问题讨论了 net 模块所需的修复以及调用 httpbin.org 所需的 SSL 实现的特定版本:
HTTPS (SSL) get request with NodeMCU
HTTPS get requests with NodeMCU and ESP8266
该版本是今天创建的,由 mbedTLS 提供 TLS/SSL 支持。
【问题讨论】: