Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for HTTPS to ESP32 #960

Closed
nkolban opened this issue Oct 25, 2016 · 3 comments
Closed

Add support for HTTPS to ESP32 #960

nkolban opened this issue Oct 25, 2016 · 3 comments
Labels
enhancement ESP32 This is only a problem on ESP32-based devices

Comments

@nkolban
Copy link
Contributor

nkolban commented Oct 25, 2016

Add support for HTTPS to ESP32 board. This issue will track research and development for this capability.

@nkolban nkolban added enhancement ESP32 This is only a problem on ESP32-based devices labels Oct 25, 2016
@gfwilliams
Copy link
Member

It should 'just happen' if you've implemented the networking API.

HTTPS support in Espruino sits on top of the socket API, so it works on any platform (assuming there is the RAM/ROM for it).

Just use the correct USE_XXX defines in the Makefile and it'll work. You'll also get crypto functionality too.

I'd advise against using the Espressif provided implementation - it'll be a lot of work to drag it in, and will probably involve a whole load of ifdef ESP32 all over the HTTP and networking codebase

@nkolban
Copy link
Contributor Author

nkolban commented Oct 27, 2016

Exactly as you said, it worked 1st time without ANY hooking in of https libraries from ESP32 land. ESP32 has hardware assist for SSL/TLS but these require the use of the ESP32 native libraries. However, since all is working, there is zero imperative to leverage these at this time. The sample program that I used to test was:

// Connect to an access point and get a web page.
//
var ssid="guest";
var password="kolbanguest";

var wifi=require("Wifi");
wifi.connect(ssid, {password: password}, function() {
  console.log("Connected to access point, getting web page");
  var http = require("http");
  http.get("https://httpbin.org/ip", function(res) {
    res.on('data', function(data) {
      console.log(data);
    });
  });
});

@nkolban nkolban closed this as completed Oct 27, 2016
@gfwilliams
Copy link
Member

Great! Yeah, I guess at some point we could look at abstracting the support out, but for now it should be fine for pretty much everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ESP32 This is only a problem on ESP32-based devices
Projects
None yet
Development

No branches or pull requests

2 participants