0

I'm using a NodeMCU, which is connected to an enterprise network at a school. The information given in the GET requests that the ESP8266 sends is sensitive, so naturally we want to make it secure and encrypted - enter SSL. We do the request like so;

HTTPClient http.begin(url, thumbprint)

However, on the network at the school, doing this request fails 90% of the time, so I did a few tests - 100 requests to the exact same IP and certificate, noting how many went through;

  • School network
    • HTTPS requests: 10/100 successful [10%]
    • HTTP requests: 100/100 successful [100%]
  • Private home network
    • HTTPS requests: 100/100 successful [100%]
    • HTTP requests: 100/100 successful [100%]

We have also tried using the WiFiClient class, and while 100% of the requests went through, each one took 15 seconds which is too long.

My question is; what would the problem be, and what can we do to fix it? Can I do something in the code, or on the network?

  • Do you get any error messages? – Gerben Aug 28 '18 at 12:47
  • @Gerben No stack errors, the response contains nothing and the HTTP code is -11 – Albert MN. Aug 28 '18 at 12:48
  • Your school probably uses a proxy which tries to filter out phishing sites or something. It's possible that it only works fast for white-listed domains. – Dmitry Grigoryev Aug 28 '18 at 12:57
  • I asked about this, and they told me there was nothing blocking my site. Again, it works 10% of the time. They said there was no firewall... – Albert MN. Aug 28 '18 at 13:01
  • 1
    Have you tried increasing the timeout (HTTPClient.setTimeout) until you get 100% success? – Craig Aug 28 '18 at 16:19
1

Increase the timeout for your request with HTTPClient.setTimeout(). Note the timeout is in milliseconds.

HTTPClient http;
http.setTimeout(15000); // 15 Seconds
http.begin(url, thumbprint);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.