I am working on a weather app for the Wio Terminal and I would like to get data from NOAA using the domain api.weather.gov, and Open Weather Map using the domain api.openweathermap.org. Both sites require SSL connections. However, while I am able to get this to work with api.openweathermap.org, it is not working for api.weather.gov. While the connect() call returns successfully, any further IO fails. It appears the socket closes prematurely.
While trying to track down this problem, I wrote a simple test program that connects to www.example.com 1, api.openweathermap.org, api.weather.gov, and www.howsmyssl.com, using WiFiClientSecure and performs a simple GET after connected. The first two work fine. The third (api.weather.gov) fails as mentioned above where the connect succeeds but further I/O fails. The fourth (www.howsmyssl.com) never connects at all and times out. So only two out of four sites work.
Here is a link to my test program: https://drive.google.com/file/d/18rYuFaIJhUcWtbdgM4IFpKLGg7e-ngzV/view?usp=sharing
Note you will need to change the SSID and Wifi Password to run it.
Below is a sample run. Note the first two sites work, the third “connects” but has a file descriptor of -1, so nothing else works after that, and the third simply times out.
Attempting to connect to SSID: <omitted> Connected to <omitted> Starting connection to www.example.com Connected to server! File descriptor: 0 Sending GET request Wrote request, wn=60 Reading response... Headers received Read 1256 bytes. Stopping WiFiClientSecure connection... Starting connection to api.openweathermap.org Connected to server! File descriptor: 0 Sending GET request Wrote request, wn=72 Reading response... Headers received Read 107 bytes. Stopping WiFiClientSecure connection... Starting connection to api.weather.gov Connected to server! File descriptor: -1 Sending GET request Wrote request, wn=0 fd=-1, errno=88 Stopping WiFiClientSecure connection... Starting connection to www.howsmyssl.com LastError: SSL - The connection indicated an EOF Connection failed! All sites processed.
I am running 2.1.1 firmware, and downloaded fresh copies of rpcWifi (master), rpcUnified (master), and mbedtls (dev) on 2/14/2021 (yesterday). Any help would be appreciated.