DaKaZ / esp8266-restclient

Arduino RESTful HTTP Request Library
MIT License
124 stars 26 forks source link

Wifisecure has moved to Bear SSL api #11

Open Duckle29 opened 5 years ago

Duckle29 commented 5 years ago

As detailed here: https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/WiFiClientSecure.h#L27

Duckle29 commented 5 years ago

I'm working on fixing this. I'll also add a library.json so that the library can more easily be used in platformio.

If you're interested I could make a PR for the master branch on the Hal9k-dk fork? It currently is just using the old API, however, I think the change to bearSSL is simple enough (check out the 2.0 branch)

Duckle29 commented 5 years ago

The fixes are live here: https://github.com/Hal9k-dk/esp8266-restclient If you want me to open a PR, let me know. Otherwise, I'm up for just maintaining it on hal9k.

I have also made a test-sketch for the ESP, and it works, kinda.

I have noticed that the tests always complete successfully when using SSL, but when using normal HTTP, it is very dependent on signal strength. If the ESP has a good connection to wifi, most HTTP tests will pass, but if it doesn't, most will fail. All while all SSL tests still succeed. I can't see any other reason for this that wificlientsecure is more reliable than wificlient.

If you run the test yourself, the first request will most likely have a several second latency, as the heroku app will be sleeping (the free plan has them sleep after 30 mins of inactivity)