-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Latest WiFiClientSecure client (github 16Jan23) is broken by “client.println("");” #7731
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
Comments
@Rob58329 That's interesting and worth investigating. Can you narrow down which commit caused the failure? https://github.com/espressif/arduino-esp32/commits/master/libraries/WiFiClientSecure/src. Try different versions of arduino-esp32. The fact that println() comes from Print.cpp.
The only recent change I see for Print.cpp is on 2022.12.21. https://github.com/espressif/arduino-esp32/commits/master/cores/esp32/Print.cpp |
@mrengineer7777: I forgot to mention that this is only an issue for WiFiClientSecure, this does NOT happen if using "WiFiClient client". IE the non-encrypted client.println(""); works fine! This is why I suspected it was due to a change in WiFiClientSecure, |
arduino-esp32-4b3f5c8ed463b18afe28d132d607bbf164d8eec9_v18Feb2021 "Remove temp buffer in WiFiClientSecure::lastError" (#4822) works. arduino-esp32-a0ddd8a16e744b04ee58a7015742b582bc11eea7_IDF_v22Feb21_11:06gmt "IDF release/v3.3" fails. arduino-esp32-560c0f45f58b907f0d699f65408b87fe54650854_v22Feb202_17:34gmt “Fix dropped SSL connection when buffer gets full. (https://github.com/espressif/arduino-esp32/pull/4820)” fails. ie. it appears that it is the “IDF release/v3.3 7a85334d8 (https://github.com/espressif/arduino-esp32/pull/4813)” performed on 22Feb21 at 11:06gmt which causes the WiFiClientSecure.println(“”) to FAIL. |
@Rob58329 Nice research. To summarize for WiFiClientSecure: Possibilities: Could be a change in IDF. Could be that
Note that send_ssl_data() now has a timeout to break out of the loop. Earlier versions of the code looped indefinitely. To proceed further: turn on verbose log messages (CORE_DEBUG_LEVEL=5). ssl_client.cpp prints verbose messages that should help pinpoint where the communications are failing. |
@Rob58329 What did you see when you turned on verbose logging? |
Using: (https://github.com/espressif/arduino-esp32 as at 16Jan23)
After client.println(""); is added gives:
This addition causes the line: Writing HTTP request with 0 bytes... (and subsequent error) |
If you look at the source of |
I confirm that
I need this to indicate the end of headers by an empy line and cannot use |
Hello, this seems to me like a question which was already answered so I'm closing it, if needed, feel free to reopen. |
Board
ESP32 DevKitv1
Device Description
Nothing attached
Hardware Configuration
Defauult config
Version
other
IDE Name
1.8.19
Operating System
Windows10
Flash frequency
80MHz
PSRAM enabled
no
Upload speed
921600
Description
For the current (https://github.com/espressif/arduino-esp32 as at 16Jan23) WiFiClientSecure client, if you do a client.println("");” this breaks the WiFiClientSecure client: although the line eventually returns, the “WiFiClientSecure” buffer gets corrupted and the secure connection doesn’t work.
Note that the old github May2021 had a different “WiFiClientSecure” which was not broken by “client.println("");”
NB. if you consider this issue not worth fixing, please feel free to close this issue!
Sketch
Other Steps to Reproduce
n/a
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: