ESP8266 can't make an HTTPS GET request

Here we can discuss about the problem found
Post Reply
ChipBurner
Posts: 7
Joined: Tue Mar 19, 2024 6:54 am
Has thanked: 1 time

ESP8266 can't make an HTTPS GET request

Post by ChipBurner »

Hi,
I tried the example from WGET$ help by ESP8266 v1.49. Text of the program:

Code: [Local Link Removed for Guests]

' do an HTTPS GET request
a$=WGET$("https://jsonplaceholder.typicode.com/comments?id=1&id=4")
PAUSE 5000
print a$
wlog a$

ONWGETASYNC answer_done
WGETASYNC("jsonplaceholder.typicode.com/comments?id=1&id=4", 443)
Wait

answer_done:
b$=WGETRESULT$
Print b$
wlog b$
Return
Result:
Connection Failed
<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
<hr><center>cloudflare</center>
</body>
</html>


Sometimes ESP266 reboots due to an exception.
Exception (3):

epc1=0x40101927 epc2=0x00000000 epc3=0x00000000 excvaddr=0x4005fedc depc=0x00000000
User avatar
cicciocb
Site Admin
Posts: 1997
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 428 times
Been thanked: 1336 times
Contact:

Re: ESP8266 can't make an HTTPS GET request

Post by cicciocb »

The ESP8266 is not really suggested for https:// as it has very few RAM memory.

I suggest to move toward the ESP32
ChipBurner
Posts: 7
Joined: Tue Mar 19, 2024 6:54 am
Has thanked: 1 time

Re: ESP8266 can't make an HTTPS GET request

Post by ChipBurner »

Ok, I'll keep it in mind.
Post Reply