-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR aims to address some issues encountered whilst trying to use SSL for a basic `HttpClient` download session. **Fix malloc_count link error 'undefined reference to __wrap_strdup`** Implementation also needs to call mc_malloc, not malloc. **AxCertificate destructor accesses ssl after it's been destroyed** Picked up by valgrind. **Provide time implementations in RTC.cpp, add test** Library code requires libc implementations for `gettimeofday` and `time_t`. On Esp8266 typically get `please start sntp first !` message. This should be synced with `SystemClock` so removed the `time replacement` code from AXTLS and use that. Test added to HostTests to ensure SystemClock and `time()` are synced. Checked on esp8266, rp2040, esp32s2, host. **Replace automatic SSL certificate generation with `generate-cert` build target** These don't need to be auto-generated as they're not always required. There are also multiple ways to get this information into an application. Several samples don't make use of these files, so removed. NOTE: The `make_certs.sh` script no longer appears to work, at least with openssl 3.2.1 (Jan 2024). The headers are generated but Axtls fails to load the certificate with -269 (SSL_ERROR_INVALID_KEY). **Put generated SSL certificate information into PROGMEM** Bit wasteful of RAM. **Enforce consistent 'verifyLater' behaviour with Bearssl** When attempting to fetch an https resource (using HttpClient) *without* setting request `onSslInit` we get this behaviour: - Axtls: Fails with `X509_VFY_ERROR_NO_TRUSTED_CERT` - Bearssl: No problem, goes right ahead. This behaviour with Bearssl is not desirable as it could inadvertently compromise security. Add a check on `verifyLater` and fail with `X509_NOT_TRUSTED` as appropriate. **Notes** - Add `setSslInitHandler` method to HttpClient? NO ! `Use request->onSslInit` - Does this work with lwip2 on esp8266? Doesn't appear to make things worse, but lwip2 looks to be kinda broken. Needs major update. - Certificate generation throws errors with openssl 3, this needs addressing separately as it's only really appropriate for basic testing anyway.
- Loading branch information
Showing
43 changed files
with
268 additions
and
712 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.