-
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
[ESP8266HTTPClient] Updates from HTTPS servers fail before transferring new binary begins #8079
Comments
Please run with full debugging enabled and attach the logs. That can make pinpointing things much simpler for everyone. |
I got the same error with Core 3.0.0. With Core 2.7.4 works fine. |
You will help us if you consider the previous message:
|
I will be glad to help. Would you indicate how to get the log? |
Thanks ! |
Hello, What level of debug do you require? |
I think the one before the last would give all details. |
This is all I could catch. I had to reduce the level of debug because it was scrolling too fast.
|
I just ran a test of the
|
I suggest to try to do the test from a private github repository. The bin file I am downloading is the same that works fine with core 2.7.4. |
@frankygoop sorry, but I don't have any private repos as the maintainers don't use GH professionally. If you or someone else has, say, a public |
Got the same issue with 3.0.0, works fine with 2.7.4. =============== ESP8266httpUpdate.cpp handleUpdate========== .... The above codes prints x=0 causes the "Verify Bin Header Failed" error: [httpUpdate] Header read fin. |
Again, folks, we need a public example that fails w/3.0 but passes w/the prior release. I've tried my own way several times and things "just work" so there's nothing we can do w/o a failing public example. If it's failing but you've got some proprietary code that you don't want others to download, why not build a |
I modified httpUpdate as following and reproduced it, you can try run the sketch with core 3.0.0, see if it happens.
|
Using the example posted and the remote server I am able to see the TCP connection hanging up on the ESP8266 before sending out any data:
The same happens on my local Apache HTTPS server. Switching to HTTP, the update passes:
So, it looks like Updater and the HTTPS connection are the root of the issue. Plain HTTP updates are 100%, HTTPS ones drop at the time when the raw bytes would be coming back. This isn't speed related (80/160) because that would affect the initial handshake, not the transfers. |
The conversion of the
Arduino/libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.cpp Lines 380 to 383 in f1310c0
So, basically, with HTTPS the HTTP update object shoots itself in the foot every time. :( |
Fixes esp8266#8079 Because WiFiClientSecure inherits WiFiClient, and WiFiClientSecureCtx also inherits WiFiClient, they both end up in the list of TCP connections that are used for WiFiClient::stopAllExcept(). This would cause the underlying SSL connection to be closed whenever you attempted to stopAllExcept(WiFiClientSecure) Fix by adding a "_owner" pointer in the WiFiClient object which points to nullptr (default case) or to the associated upper-layer connection. When stopping all connections except one, only look at the uppermost connections.
Folks, please give #8136 a try and report back. |
Alpha release 0.0.2 integrates #8032 if anyone without git is willing to test. |
Fixes #8079 Because WiFiClientSecure inherits WiFiClient, and WiFiClientSecureCtx also inherits WiFiClient, they both end up in the list of TCP connections that are used for WiFiClient::stopAllExcept(). This would cause the underlying SSL connection to be closed whenever you attempted to stopAllExcept(WiFiClientSecure) Fix by adding a "_owned"(by) pointer in the WiFiClient object which points to nullptr (default case) or to the associated lower-layer connection. When stopping all connections except one, only look at the lowermost connections.
Sorry to ask again, maybe was not related to this but still, to be able to update from a private repository in Github, I need to add two headers to the Esp8266HttpUpdate.cpp http.addHeader(F("Accept"), "application/vnd.github.v3.raw"); Thanks |
http update not working on this arduino-core version
HTTP_UPDATE_FAILD Error (-106): Verify Bin Header Failed;
I just instaled arduino core 2.7.4 and it worked.
NodeMCU 1.0, Arduino 1.8.15, code
httpUpdateSecure
The text was updated successfully, but these errors were encountered: