HTTPS 数据检索错误

HTTPS data retrieval error

我有一个安装了 NodeMCU 固件的 ESP12(模块:httptls 等)。

每当我尝试将 http.get 与 https link 一起使用时,我都会收到以下错误:

> http.get("https://pastebin.com/raw/cAB83eF1", nil, function(code, data)
>> if (code < 0) then
>> print("HTTP request failed")
>> else
>> print(code, data)
>> end
>> end)
> HTTP client: Disconnected with error: -114
HTTP client: Connection timeout
HTTP client: Connection timeout

当我在没有 https 的情况下尝试相同的 pastebin.com link 时,我能够接收数据和 HTTP 状态代码。

> http.get("http://pastebin.com/raw/cAB83eF1", nil, function(code, data)
>> if (code < 0) then
>> print("HTTP request failed")
>> else
>> print(code, data)
>> end
>> end)
> 200   test

引自docs of http.get

Each request method takes a callback which is invoked when the response has been received from the server. The first argument is the status code, which is either a regular HTTP status code, or -1 to denote a DNS, connection or out-of-memory failure, or a timeout (currently at 10 seconds).

既然文档说有效代码是 -1 和 HTTP 代码,我怎样才能找出什么是 -114?

Edit1:在打开调试选项的情况下构建固件之后。我收到以下错误:

> http.get("https://pastebin.com/raw/cAB83eF1", nil, function(code, data)
>> if (code < 0) then
>> print("HTTP request failed")
>> else
>> print(code, data)
>> end
>> end)
> client handshake start.
please start sntp first !
please start sntp first !
client handshake failed!
Reason:[-0x7200]
HTTP client: Disconnected with error: -114
HTTP client: Connection timeout
HTTP client: Connection timeout
=rtctime.get()
1501394767  272709
>

根据日志语句 Reason:[-0x7200] 0x72 十六进制为 -114 十进制,稍后打印 Disconnected with error: -114.

sntp.sync() 也已经执行,从 rtctime.get() 的输出可以看出。即使 SNTP 已同步,为什么会打印消息 please start sntp first !

稍后在日志中,在 -114 消息之后,它显示 Connection timeout 消息。如何更改 https 连接的超时时间?任何指向 C/header 个文件的指针?

注意:我确实在 Linux 机器上安装了 git 存储库和 docker 图像以构建固件。

PS:我需要 https,因为我要让我的 ESP12 与云端托管的 RESP API 通信。

这是一个简短且不能令人满意的答案:您点击了 https://github.com/nodemcu/nodemcu-firmware/issues/1707