GithubHelp home page GithubHelp logo

Comments (9)

mobizt avatar mobizt commented on July 21, 2024

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.

mobizt avatar mobizt commented on July 21, 2024

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.

RazmigAvedis avatar RazmigAvedis commented on July 21, 2024

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.

RazmigAvedis avatar RazmigAvedis commented on July 21, 2024

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.

mobizt avatar mobizt commented on July 21, 2024

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.

mobizt avatar mobizt commented on July 21, 2024

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.

RazmigAvedis avatar RazmigAvedis commented on July 21, 2024

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

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.

mobizt avatar mobizt commented on July 21, 2024

That is because the basic client is stopped or the BearSSL engine was already closed.

from esp_sslclient.

mobizt avatar mobizt commented on July 21, 2024

This is the session resumption example.

from esp_sslclient.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.