-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
StreamHttpsClient.ino crashes #5216
Comments
The crash is actually in HTTPClient.cpp:
Got to get to work now, but the member |
Problem by inspection is the example code is that it You've destroyed the WiFiClientSecure, but HTTPClient is using it in its destructor, which is a no-no. Need to rethink the HTTPClient destructor to not touch |
The best solution to me looks like just clearing out |
@earlephilhower just created PR #5220 to fix the issue. Thanks for your help! |
Reopening to track. Will close when the PR is approved and merged. |
Fixed w/#5220 |
@earlephilhower, the fix is not handling a Connection: Keep-Alive correctly. The Object should survive an end() to be reused for a next connection. Because of the fix the connection is always closed now. Keeping it open is really simple, but at destruction of the ESP8266HTTPClient the connection should be closed. This is what the object did before the fixes. But, this leads to the same issue: the destructor ~WiFiClientSecure is called before the ~ESP8266HTTPClient destructor, making it impossible to close the connection. |
* Removed _client->stop() from destructor; some minor changes * Changed BasicHttpsClient.ino to allocate BearSSL::WiFiClientSecure object on the heap in stead of stack * Removed unnecessary code * Correcting bad fix for #5216 * Minor formatting to pass Travis tests * Changed client * to std::unique_ptr<> client * Updated example
Basic Infos
Platform
Settings in IDE
Problem Description
Running StreamHttpsClient.ino crashes. Remarkable is that when I enable Debug Level: SSL+HTTP_CLIENT it runs fine. @earlephilhower as requested!
MCVE Sketch
Debug Messages
Exception decoder
The text was updated successfully, but these errors were encountered: