-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ESP8266 crashing upon HTTPS-Update when using SSL #2758
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
Update: It seems that 0x5000 bytes are getting transfered; This changes when I change the reverse-proxy from "HTTPS" to "SSL" in the AWS Beanstalk settings; Also: On the same server, with the same application it works when I just use HTTP instead. |
I've run into similar behaviour with a local apache and letsencrypt cert. There does seem to be some fine-lines with SSL and HTTPUpdate to do with memory usage/corruption - I found the same thing with poisoning on. Like you I've had no issue with changing only https to http (so everything else remains the same). |
For what it's worth, I'm also having this issue with 2.3.0-rc2 when trying to pull a small bin over HTTPS. Server side is similar to above, Let's Encrypt cert with httpd/apache2. ssl->need_bytes=16432 > 6859 |
Does anyone have any update on this issue that I'm also experiencing ? That's too bad as HTTPS OTA allows to be sure that's the binary comes from my server not from one faking to be. |
this error is probably caused due to corrupt flash memory. in order to completely format flash use following code. |
Signed updates can also be used to verify the update origin and may be a viable alternative in the interim. |
I'm seeing this exact behavior pulling updates from GitHub. The issue persists with |
Facing the same issue. |
I'm seeing this same issue, however I think @davisonja is correct regarding being out of memory. I'm using latest master branch build fetched today:
I can fetch a JSON file via TLS/SSL once. However during that first fetch, I am building a linked list of objects (aka chewing up heap memory). The second time around when I fetch it again to update those objects, I get this error:
Apparently I need 16,448 bytes of heap, but I have only 6,859. So I've inserted a bunch of
that can be used like this:
resulting in UART output like this:
My plan is to write most of the object data to SPIFFS instead of using RAM. (and make sure I'm not wasting heap with duplicate object creations, etc) I'm wondering if the amount of heap needed is dependent on the overall size of the TLS payload, or if the stream can be decrypted in a fixed amount of memory? The default seems to be the axTLS; I thought I remember seeing BearSSL support coming soon. I wondering how to use that instead and if it uses less memory? *edit: see also #1375 (comment) regarding buffer and key size |
Bearssl is already merged, albeit experimental. Api is ~99% same as axtls. |
aha! yes, but it is Unfortunately for me, a straight-up replacement of the client declarations with the BearSLL type does not work. The sample works, and gives an interesting tutorial on proper validation of certs. Looks like perhaps the easiest method may be In any case there is still a memory leak problem in the axTLS as noted in this thread; It was not just my code using up a bunch of heap space. Although that certainly was part of my problem. I'm currently working on a separate project to demonstrate the bug, however I have not yet been able to reproduce it in that tiny, controlled environment yet. I have two solutions though: The first is a brute-force replacement of the client when I am done fetching a file. This is certainly not the most graceful, however it is effective:
The second I found in issue #4733 - specifically @5chufti 's sample code here: #4733 (comment) where @d-a-v creates a tcp cleanup:
and then use it like this:
Both methods work for me. Both seem like a band-aid to an underlying problem. It would appear the default destructor properly cleans up (and closes the same tcp connections?) - but the I'm not sure if garbage cleanup is needed with delay / yield. (?) |
Bugs traced to axtls won't be fixed. Because of the long list of issues, and that it is no longer maintained, it is planned for deprecation and eventually will be retired. I strongly advise you to spend effort migrating to bearssl instead of demonstrating a bug in axtls. The tcpcleanup shown by @d-a-v shouldn't be necessary when using latest git. Same goes for that mem leak. Are you using latest git, or latest release 2.4.1? |
@devyte thank you for that information! (you've saved me a ton of time) Yes, I am using this git version:
but the tcpcleanup cleanup is definitely needed (and works well) with the axTLS for my code. I will work on migrating my code to use BearSSL instead. Thanks again :) |
Closing as axtls related w/OOM issues. |
Upon executing
The EPS8266 crashes. This only happens when
The update server is running on AWS Elastic Beanstalk, certificate also is from AWS.
Is there a known problem when dealing with that situation?
Here is my crashlog, incuding some debugging information I inserted into the update protocol:
The text was updated successfully, but these errors were encountered: