Arduino client.connect因api.github.com和HTTPS失败

时间:2018-09-02 21:06:34

标签: arduino arduino-ide arduino-esp8266

我正在尝试从我的Arduino向api.github.com发出HTTPS请求。但是,client.connect总是失败,我不确定为什么。

#include <WiFiClientSecure.h>
...
WiFiClientSecure client;
char*  githubHost = "api.github.com";
String githubURL = "/repos/esp8266/Arduino/commits/master/status";
String githubPayload = getJsonHTTP(githubHost, githubURL);
...

String PaperSignals::getJson(String host, String url){

        Serial.print("connecting to ");
        Serial.println(host);

        if (!client.connect(host.c_str(), httpsPort)) {
                  Serial.println("connection failed");
                  return "bad";
        }
        ...
}

输出仅显示“连接失败”。我可以访问专门针对client.connect的更详细的调试日志吗?

0 个答案:

没有答案