Comments (9)
That is the time require to wait until the SSL handshake was done.
You should keep the session to open since connection established if you don't want SSL handshake to be done everytime you want to send/receive data.
from esp_sslclient.
You should call connect()
only once and don't call stop()
when you often send/receive data to/from the same host and uri (in case of http).
The memory usage during session opened is relatively small (512 bytes to 16k) when compared to available memory in ESP32 then I recommend keeping connection open is better.
from esp_sslclient.
I am using the same host but multiple (4) uris.
Is session caching handled in the library under the hood or should I do it using the function setSession?
from esp_sslclient.
Also, if I want to check if the session did not disconnect and reconnect in the case the connection dropped, do I use an if condition on .connected()
?
from esp_sslclient.
The connected()
or available()
method alone without sending the request will not always return the actual server connection status unless your Client has implemented TCP KeepAlive as in ESP32 WiFiClient
(via lwIP setsockopt
).
The available()
returns the remaining bytes that do not yet read from receive buffer even connection was closed.
I don't see TCP keepalive implemented in the Ethernet library driver which is available in W5500 chip firmware.
You can use ping or opening another connection to server to test that server is alive (respond) periodically in this case.
from esp_sslclient.
I forgot your question about session resumption.
You can save crypto settings in BearSSL_Session
and resume it for faster handshake.
By define the BearSSL_Session
in global and pass its pointer to setSession
like this.
BearSSL_Session session; //Global object
ssl_client.setSession(&session);// Assign its pointer
from esp_sslclient.
I forgot your question about session resumption.
You can save crypto settings in
BearSSL_Session
and resume it for faster handshake.By define the
BearSSL_Session
in global and pass its pointer tosetSession
like this.BearSSL_Session session; //Global object ssl_client.setSession(&session);// Assign its pointer
Hello, I managed to reduce the connection time with this. but i have a question. I am getting the following error:
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
ERROR.available: Cannot operate on a closed SSL connection.
when this happens the firmware is getting stuck. What does this mean and how can I fix it?
Thanks alot!
from esp_sslclient.
That is because the basic client is stopped or the BearSSL
engine was already closed.
from esp_sslclient.
This is the session resumption example.
from esp_sslclient.
Related Issues (10)
- EthernetClient not connecting HOT 5
- MQTT-TLS with Ethernet w5500 HOT 2
- JWT error (Off-Topic) HOT 24
- Data loss HOT 3
- connectSSL hangs HOT 6
- Does not keep connection open HOT 4
- Allow custom Port HOT 7
- mqtt/tls configuration error HOT 34
- MQTT-TLS with Ethernet w5500 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp_sslclient.