我正在尝试从我的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
的更详细的调试日志吗?