Sorry, the esp8266 does not have the required libs compiled in. It does not support https requests.
The esp32 works fetching the google site as a secure page. What secure site is it you want to use?
If you use your code above and change the request to one of the site in comment #4 you see that it does work with the esp32
@Wilberforce started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Sorry, the esp8266 does not have the required libs compiled in. It does not support https requests.
The esp32 works fetching the google site as a secure page. What secure site is it you want to use?
If you use your code above and change the request to one of the site in comment #4 you see that it does work with the esp32