Reusing ESP_SSLClient for other SSL uses (MQTT)? #308
Replies: 2 comments
-
The ESP_SSLClient is not compatible with the OpenSLab's SSLClient anymore and the code is heavily based on Earle F. Philhower's ESP8266 WiFiClientSecure instead. |
Beta Was this translation helpful? Give feedback.
-
In the version 3.4.0 afterward, you should follow the new example to use library correctly. You should pass the basic client (network Client) i.e., Those functions are not accepting SSL Client. You can create your other instance of Because of different servers and ports for mail and mqtt servers, you don't have to use the same SSL Client for them. You can close the TCP session of mail client to gain free memory before starting your mqtt connection. |
Beta Was this translation helpful? Give feedback.
-
This library looks like what I'm going to use going forward for my email use cases; prior to finding it I was looking at hacking together something with the existing SSLClient Library and the various other email libraries out there.
After finding this repo and seeing that it relies on the ESP_SSLClient Library I was curious how I'd go about reusing that secure connection for other purposes?
One big advantage of the ESP version is that unlike the former option I linked it does not require me to manually generate "Trust Anchor" data files for each endpoint I'm communicating with (although maybe that's an advantage in some cases). ESP_SSLClient seems to automatically be able to validate SSL certificates dynamically.
If I wanted to reuse the same library for other SSL uses would I first have to call
ESP_MAIL_DISABLE_SSL
as a build flag, create an ssl client like thisssl_client.setClient(ðernet_client);
, and then pass it to an smtp session,smtp.setEthernetClient(&ssl_client, ...)
Beta Was this translation helpful? Give feedback.
All reactions