GithubHelp home page GithubHelp logo

connectSSL hangs about esp_sslclient HOT 6 CLOSED

mobizt avatar mobizt commented on July 21, 2024
connectSSL hangs

from esp_sslclient.

Comments (6)

mobizt avatar mobizt commented on July 21, 2024

You may have to increase TINY_GSM_RX_BUFFER in GSM library.

The rx buffer setting via setBufferSizes should be larger than your data + some cipher suite.

This depends on the fragmentation supports on server.

If server does not support fragmentation, this buffer should set to 16k which is possible in ESP32.

from esp_sslclient.

SandroSartoni avatar SandroSartoni commented on July 21, 2024

Hi @mobizt, I have updated both TINY_GSM_RX_BUFFER and setBuffersizes function to have 16384 bytes for the RX buffer but the error still occurs. It does not happen for every transmission, sometimes it goes through just fine while other times it shows the error I reported in the previous post.
On another note, a new error that I had never seen before came up in one of the POST requests:

ERROR.mUpdateEngine: Error reading bytes from basic client. Write Error: 0
ERROR.mConnectSSL: Failed to initlalize the SSL layer.
ERROR.mConnectSSL: Unknown error code

from esp_sslclient.

mobizt avatar mobizt commented on July 21, 2024

You're starting SSL connection (SSL handshake) without stopping the current connection which there are some data that is waiting for read.

You have to review your code logic to make it work properly.

from esp_sslclient.

SandroSartoni avatar SandroSartoni commented on July 21, 2024

Thank you for your reply. I am not sure what you mean by stopping the current connection: the code I reported is taken from one of the sketch examples reported in the library, the "http upgrade" one.

from esp_sslclient.

mobizt avatar mobizt commented on July 21, 2024

I mean session or TCP session hope you understand.

The session was not re-used in the examples, and it works normally.

The error showed that you start a new connection while the session was opened and the BearSSL engine is in writing or reading for incoming data state. You have to terminate the sever connection before starting new connection.

This is your code logic and timing issue.

from esp_sslclient.

mobizt avatar mobizt commented on July 21, 2024

The http upgrade is not needed for normal application unless IMAP and SMTP applications.

For GSM module, the simple example is here.
https://github.com/mobizt/ESP_SSLClient/blob/main/examples/gsm/gsm.ino

from esp_sslclient.

Related Issues (5)

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.