Topic: spontaneous connection refusal in wolfSSL_connect(ssl)
Since last Thursday, I have been experiencing an issue retrieving precipitation data from buienradar.nl. The configuration had been working without any problems for about 4 years. The system is now returning a -313 error, which, according to the documentation, appears to be a cipher suite error.
The strange thing is that the same code has continued to work with other sites used to retrieve electricity prices—for example, dataportal-api.nordpoolgroup.com and web-api.tp.entsoe.eu.
When I check which cipher suites are supported using:
nmap --script ssl-enum-ciphers -p 443 gpsgadget.buienradar.nlI find that they all support `TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256` (using the `ecdh_x25519` key exchange)—a fact I have verified for the connection to Nord Pool Group.
I have tried adding more cipher suites, but that does not seem to be where the problem lies. There is approximately 90kB of RAM available. I hope someone can tell me how to resolve this issue. The site itself seems to be working; in the browser, I receive the expected response at:
https://gpsgadget.buienradar.nl/data/ra … p;lon=5.17
The log shows:
17:13:47 wolfSSLlog: 2, wolfSSL Entering TLSv1_2_client_method_ex
17:13:47 wolfSSLlog: 2, wolfSSL Entering wolfSSL_new
17:13:47 wolfSSLlog: 2, wolfSSL Entering ReinitSSL
17:13:47 wolfSSLlog: 1, RNG_HEALTH_TEST_CHECK_SIZE = 128
17:13:47 wolfSSLlog: 1, sizeof(seedB_data) = 128
17:13:47 wolfSSLlog: 2, wolfSSL Entering SetSSL_CTX
17:13:47 wolfSSLlog: 2, wolfSSL Entering wolfSSL_NewSession
17:13:47 wolfSSLlog: 1, InitSSL done. return 0 (success)
17:13:47 wolfSSLlog: 1, wolfSSL_new InitSSL success
17:13:47 wolfSSLlog: 3, wolfSSL Leaving wolfSSL_new InitSSL =, return 0
17:13:47 wolfSSLlog: 1, TLS 1.2 or lower
17:13:47 wolfSSLlog: 2, wolfSSL Entering wolfSSL_connect
17:13:47 wolfSSLlog: 2, wolfSSL Entering ReinitSSL
17:13:47 wolfSSLlog: 2, wolfSSL Entering SendClientHello
17:13:47 wolfSSLlog: 1, Adding signature algorithms extension
17:13:47 wolfSSLlog: 1, growing output buffer
17:13:47 wolfSSLlog: 1, Signature Algorithms extension to write
17:13:47 wolfSSLlog: 1, Point Formats extension to write
17:13:47 wolfSSLlog: 1, Supported Groups extension to write
17:13:47 wolfSSLlog: 1, SNI extension to write
17:13:47 wolfSSLlog: 1, Shrinking output buffer
17:13:47 wolfSSLlog: 3, wolfSSL Leaving SendClientHello, return 0
17:13:47 wolfSSLlog: 1, connect state: CLIENT_HELLO_SENT
17:13:47 wolfSSLlog: 1, Server state up to needed state.
17:13:47 wolfSSLlog: 1, Progressing server state...
17:13:47 wolfSSLlog: 1, ProcessReply...
17:13:47 wolfSSLlog: 1, received record layer msg
17:13:47 wolfSSLlog: 1, got ALERT!
17:13:47 wolfSSLlog: 1, Alert type: internal_error
17:13:47 wolfSSLlog: 0, wolfSSL error occurred, error = 80
17:13:47 wolfSSLlog: 0, wolfSSL error occurred, error = -313
17:13:47 ENTSO.ino: 518 ERROR: wolfSSL_connect failed
17:13:47 wolfSSLlog: 2, wolfSSL Entering wolfSSL_get_version
17:13:47 wolfSSLlog: 2, wolfSSL Entering wolfSSL_get_cipher
17:13:47 wolfSSLlog: 2, wolfSSL Entering wolfSSL_get_current_cipher
17:13:47 wolfSSLlog: 2, wolfSSL Entering wolfSSL_CIPHER_get_name
SSL version is TLSv1.2, SSL cipher suite is NONE The code is executed on STM32 Blackpill, the IDE is Arduino. WolfSSL version is 5.9.4
The stripped used code is in the attachment.