Skip to content

Connection problem via https ESP32S2 #6117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
Chicco7 opened this issue Jan 9, 2022 · 3 comments
Closed
1 task done

Connection problem via https ESP32S2 #6117

Chicco7 opened this issue Jan 9, 2022 · 3 comments
Labels
Area: BT&Wifi BT & Wifi related issues Resolution: Expired More info wasn't provided

Comments

@Chicco7
Copy link

Chicco7 commented Jan 9, 2022

Board

ESP32S2 WROVER

Device Description

Only the board, not pcb attached

Hardware Configuration

Nothing attached

Version

latest master

IDE Name

Arduino IDE

Operating System

Windows 10

Flash frequency

OTA or 80MHz

PSRAM enabled

yes

Upload speed

921600

Description

Hi, I use the latest 2.02 arduino core but I have an issue with the https connect. It work well one-two time, after the connection failed.
If I use the 2.01 version all work well.
The debug show connection failed with -1 error

I tried various option (PSRAM, no PSRAM), and various code configuration but the issue still happaning. My only solution is to downgrade to 2.01. I don't tried the 2.00.

Sketch

WiFiClientSecure client;

  client.setInsecure();

  if(client.connect(server, 443)) {
    client.setTimeout(30);
    TelnetStream.println("Connected to server");
    client.println("POST /api/measurements HTTP/1.0");
    client.println("Host: *******");
    client.println("Authorization: Bearer " + String(token));
    client.println("Content-length: " + String(parameters.length()));
    client.println("Connection: Close");
    client.println("Content-Type: application/json;");
    client.println();
    client.println(parameters);
    client.stop();
  }

Debug Message

If needed I can get it

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@Chicco7 Chicco7 added the Status: Awaiting triage Issue is waiting for triage label Jan 9, 2022
@maspetsberger
Copy link

I can confirm the same problem on ESP32-C3.
A WiFiClientSecure object cannot be used after closing a connection. This breaks several libraries depending on it.

The problem is caused by f29f448 and the changes introduced in lines:

memset(ssl_client, 0, sizeof(sslclient_context));

memset(ssl_client, 0, sizeof(sslclient_context));

This not only resets all pointers (as intended) but it also sets all other fields in the struct to 0, including handshake_timeout. This in turn never has a chance to complete it in

if((millis()-handshake_start_time)>ssl_client->handshake_timeout)

@VojtechBartoska
Copy link
Contributor

Hello, can you please retest this on v2.0.3-rc1?

@VojtechBartoska VojtechBartoska added Area: BT&Wifi BT & Wifi related issues Resolution: Awaiting response Waiting for response of author and removed Status: Awaiting triage Issue is waiting for triage labels Apr 11, 2022
@VojtechBartoska
Copy link
Contributor

I'm closing the issue as expired due to no answer.

If needed, please reopen it.

Thanks for understanding.

@VojtechBartoska VojtechBartoska added Resolution: Expired More info wasn't provided and removed Resolution: Awaiting response Waiting for response of author labels May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: BT&Wifi BT & Wifi related issues Resolution: Expired More info wasn't provided
Projects
None yet
Development

No branches or pull requests

3 participants