Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

HTTPS not supported? #2

Closed
julienaltieri opened this issue Nov 1, 2020 · 4 comments
Closed

HTTPS not supported? #2

julienaltieri opened this issue Nov 1, 2020 · 4 comments
Labels
Support Library support wontfix This will not be worked on

Comments

@julienaltieri
Copy link

ESP32 crashes when calling a "https://" url. This is 100% replicable on my ESP32 from the provided example: try changing the toronto.txt to an https address and the below issue happens. Since I needed to use this for REST API calls, SSL is required since I need to pass API keys. Here is what happens when I try to call GET on an https address:

Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
After a bit of googling, I found this happens when there is some sort of null pointer access.
After decoding the backtrace:

0x400d1a59: xbuf::write(char const*) at C:\Users\User\Documents\Arduino\libraries\AsyncHTTPRequest_Generic\src/utility/xbuf_Impl.h line 50 0x400d239a: AsyncHTTPRequest::_buildRequest() at C:\Users\User\Documents\Arduino\libraries\AsyncHTTPRequest_Generic\src/AsyncHTTPRequest_Impl_Generic.h line 527 0x400d24c9: AsyncHTTPRequest::send() at C:\Users\User\Documents\Arduino\libraries\AsyncHTTPRequest_Generic\src/AsyncHTTPRequest_Impl_Generic.h line 156 0x400d2ecb: sendRequest() at C:\Users\User\Desktop\RemoteJi/b_firebaseHandler.ino line 24

@khoih-prog
Copy link
Owner

khoih-prog commented Nov 1, 2020

The current version of AsyncHTTPRequest_Generic Library is based on

  1. AsyncTCP Library and
  2. asyncHTTPrequest Library

and all don't support HTTPS yet, AFAIK. I haven't tested any of them with HTTPS yet.

As this AsyncHTTPRequest_Generic Library is intended to support mainly other boards besided ESP32/ESP8266, I suggest you'd better post an issue in

  1. AsyncTCP Library and
  2. asyncHTTPrequest Library

Also check

  1. SSL support?
  2. mbed TLS client support, try 2
  3. Can't make secure HTTP (HTTPS) request issue in asyncHTTPrequest Library.

Sorry, the library only supports HTTP requests. HTTPS is not possible on the ESP8266 due to heap issues. On the ESP32, the underlying asyncTCP does not have support for TLS (HTTPS).

Please update if you found out solutions later.

@khoih-prog khoih-prog added Support Library support wontfix This will not be worked on labels Nov 1, 2020
@khoih-prog
Copy link
Owner

khoih-prog commented Nov 9, 2020

@julienaltieri

Can you post the simplified sketch to enable duplicating the issue.

I'll try to find out why and, if possible, add the HTTPS support to these Libraries, including this AsyncHTTPRequest_Generic.

I'm using SSL successfully in Blynk_Async_WM Library to connect to SSL Local Blynk Server. Also check Using Private Blynk server in SSL mode and see Async SSL is working, using ESPAsyncWebServer.

But certainly, you have to store Server's SSL Public Certificates locally in the ESP32/ESP8266 boards. Did you?

Good Luck with your project.

@julienaltieri
Copy link
Author

Simplest example is from this sketch
When I replace http by https, I can trigger the error.
Note that I get no issue accessing this same https:// address using the classic HTTPClient for ESP32 as described in this post
(note the capital HTTP in HTTPClient which is different from the traditional Arduino library)

In other words, if SSL and asynchronousness are fundamentally independent (as I imagine), there should be a way to support async https on ESP32 if we could marry the best of both worlds. (although that might not be easy)

Thank you for following up on this!

This was referenced Aug 29, 2021
@khoih-prog
Copy link
Owner

Hi @julienaltieri

If you're still interested in AsyncHTTPS, now you can use the new AsyncHTTPSRequest_Generic library. Sorry for leaving the issue too long.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Support Library support wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants