-
Notifications
You must be signed in to change notification settings - Fork 7.6k
WifiClientSecure (arduino-esp32 v. 3.x) connect() fail on some server (e.g. "speechgen.io") - same code working well with 2.x #10071
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
WifiClientSecure (arduino-esp32 v. 3.x) connect() fail on some server (e.g. "speechgen.io") - same code working well with 2.x #10071
Comments
Try adding |
cool .. give me a second ;) .. i'll check |
i tested .. in first moment i was HAPPY ! .. because now it gets connected ! :)
I tested same with "api.openai.com" (which works with 3.x still), just for verification .. when adding a 'client.setPlainStart()' before .connect it connects (same as it does without) but fails too (available always true). What is 'client.setPlainStart()' doing ? any idea what i could test next ? |
ohh, hold on .. what i wrote is wrong, sorry. There is a response, let me analyze the server string in detail. I will follow up. |
this happens:
and this is the (Serial.print( c )) printed response: from "speechgen.io" server now:
and client.available() is true forever, that's why it stays in endless loop and printing endless ⸮ (with arduino-esp32 2.x (e.g. 2.0.16) i get a correct json response, with a OK header first then a valid payload, just an example (payload sends me an url to the server generated speech mp3): '{"id":"23384565", "status":1,"file": "https://speechgen.io/texttomp3/... 878333_508.mp3", "file_cors": ...} etc) hope you have an idea more .. at least i got connection, seems like 'client.setPlainStart()' raises an http vs. https issue ? |
Does someone have an idea why it fails on 3.x ? .. in case of a well know issue: |
The server is asking for a cipher renegotiation, and that is failing. It works fine if TLS 1.3 is enabled in IDF 5.1, but I have no idea why it succeeds in IDF 4.4. This issue comes from upstream, so you can open an issue at https://github.com/espressif/esp-idf/issues and tell them you have a problem with the https_request example when you change to the URL/server you want. |
I just posted the issue here: espressif/esp-idf#14298 |
@lbernstone : we got feedback from the Espressif team :) .. see here: " .. Thanks for the issue. This is due to the fact that the This has been kept disabled by default on older branches to avoid silently increasing the flash footprint for users. Please enable the fix using |
I assume this are good news, right ? Does this info help to include it in the next arduino-esp32 version ... or is there anything i have to add in my code ? Sorry in case that's a dummy question (i am not experienced in this ;) |
this is enough info. @P-R-O-C-H-Y and @lucasssvaz please one of you to make the PR to the lib-builder |
@me-no-dev I will |
thank you folks for all your help ! :) |
Board
ESP32 DevKit
Version
v3.0.3
IDE Name
Arduino IDE (1.8.19)
Operating System
Windows 7
Flash frequency
80MHz
PSRAM enabled
yes
Upload speed
115200
Description
Hope someone can review this potential issue:
WifiClientSecure client.connect("some_server_xy", 443) fail
Since upgrade to 3.x (currently using 3.0.3) my earlier code is no longer working. I spent day in searching for root cause (contacted e.g. speechgen.io support team), but found root cause yesterday (more by accident): seems to be a library 2.x to 3.x issue. I downgraded for verification to arduino-esp32 2.x (2.0.16) and same code is working well (server connect successful ..i can call their TTS service API).
So can someone maybe check why this code snippet fails with 3.x: (sketch see below) ?
Hope some folks can analyze or fix a potential bug (as my complete project is on hold now due this issue, because downgrading to 2.x is no longer an option (because lot of other 3.x features needed e.g. new /i2s_std.h).
I also tried '<NetworkClientSecure.h>', HTTPClient etc. ..instead of WifiClientSecure .. all with same result. I also used tried with actual CA certificate (instead client.setInsecure()) .. same result: Successful client.connect() with Arduino-esp32 v. 2.x , but failing with 3.x on server "speechgen.io". Some dedicated server (e.g."api.openai.com") connect succesfully with 3.x and 2.x .. but my urgent needed "speechgen.io" server fails since 3.x
Do you @me-no-dev or any other folks have an idea what might have been changed on .connect() in 3.x .. and how to solve ?
Thx !
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: