Many versions of Safari (on MacOS) have a bug in which if given an http:// url they first try the corresponding https:// url. This causes a 5 second delay in accessing http:// links on an ESP32.
Is there a way to get the ESP32 to quickly reject any HTTPS requests (port 443) so that Safari does not wait 5 seconds for a response.?
I've found resources for setting up an actual https server on an ESP32, but I don't want to incur the overhead of an actual server. I just want to quickly and efficiently inform misguided we browsers that there is no point in sending requests on port 443.
Quickly rejecting HTTPS (port 443) requests?
-
lbernstone
- Posts: 1132
- Joined: Mon Jul 22, 2019 3:20 pm
Re: Quickly rejecting HTTPS (port 443) requests?
You can base your response on the WiFiServer example. If you get a connection on port 443, just immediately send a error response. At line 70, instead of reading anything in, print a 501 response (a la line 80), and then send a stop. It may even be more effective to just send the stop.
Who is online
Users browsing this forum: ChatGPT-User and 1 guest