The only issue with HTTPS on Pixl.js is really the memory. By default mbedtls allocates big RAM buffers - they're needed for the spec but in reality you may not need them if sending small buffers (AFAIK). Then there's flash - but you can remove some stuff that's not needed there to make space.
So... You could just try compiling in HTTPS support (edit board.py, add 'TLS' under libraries and ) and maybe remove FILESYSTEM and see if it works - now you can save code to flash there's a lot more RAM than there was previously. If you need a hand let me know.
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.
Hi!
The only issue with HTTPS on Pixl.js is really the memory. By default mbedtls allocates big RAM buffers - they're needed for the spec but in reality you may not need them if sending small buffers (AFAIK). Then there's flash - but you can remove some stuff that's not needed there to make space.
So... You could just try compiling in HTTPS support (edit board.py, add
'TLS'
underlibraries
and ) and maybe removeFILESYSTEM
and see if it works - now you can save code to flash there's a lot more RAM than there was previously. If you need a hand let me know.If you run out of RAM, you could change MBEDTLS_SSL_MAX_CONTENT_LEN to 1024 at https://github.com/espruino/Espruino/blob/e06b3e24de42adb1de6e2cc6046e525880760e7d/libs/crypto/mbedtls/include/mbedtls/ssl.h#L234 and see if you have any success there.
However, it looks like newer ESP8266 firmwares actually support HTTPS (search for 'SSL' in
https://www.espressif.com/sites/default/files/documentation/4a-esp8266_at_instruction_set_en.pdf) so you could do that.
While it's not supported by Espruino firmware at the moment you could just create your own version of the esp8266 driver: https://github.com/espruino/EspruinoDocs/blob/master/devices/ESP8266WiFi_0v25.js#L89
and replace
TCP
withSSL
...