31

Put plainly: is there a way to get an HTTPS connection on the Arduino?

I have been looking in to it, and I have found it is impossible with the standard library and the Ethernet shield, but is there a custom library that can do it?

What about a coprocessor, i.e. like the WiFi shield has? Anyone know if the Arduino yún has ssl?

13

MCUs mounted on Arduinos don't have the horse power to handle https connections.

Yún does handle https on the linux side, with software like curl, wget or python. Your sketch can just delegate the task to the linux side.

While curl works fine, despite having python preinstalled, you need to manually install python-openssl, since it's not available out of the box (due to disk space constraints)

  • When you say "Yún does handle https on the linux side" do you mean Arduino Yún or the Yún Shield ? – Ciasto piekarz Jan 31 '17 at 17:12
  • curl wget or python has nothing to do with https – Peter Apr 27 at 22:08
8

(Disclaimer: I'm actually the author of the evothings.com article)
The Arduino UNO is more than capable at doing TLS. I've just finished up a blog post series on the topic. I have a working example of an Arduino UNO doing elliptic curve cryptography (sect163r2) to exchange an AES-128 key for continued communication.

http://ardiri.com/blog/utls_defining_lightweight_security_for_iot_part_1
...
http://ardiri.com/blog/utls_defining_lightweight_security_for_iot_part_8

I took an alternative approach to trying to make a true HTTPS connection - instead, this is using the same protocols under the hood but using an insecure communication channel to do so. Pretty much TLS on HTTP.

6

I don't think it is possible due to the size and complexity of the SSL Library, because the Arduino would most likely be under powered. That being said you could make the requests to a regular server and use some sort of PHP script to proxy the request to the HTTPS server. Not sure how well it would work though.

You may be interested into looking at this.

6

I list this as an answer for the sake of having it linked here. It is not full https yet but he is working on it and it may be doable in the future http://evothings.com/is-it-possible-to-secure-micro-controllers-used-within-iot/

here is a benchmark he did encrypting a message using a 1024 bit public key

Arduino UNO       16Mhz AVR               ==> 12596 ms*   8504 ms#
Arduino Leonardo  16Mhz AVR               ==> 12682 ms*   8563 ms#
Arduino Mega      16Mhz AVR               ==> 12596 ms*   8504 ms#
Arduino Due       84Mhz ARM               ==>  1032 ms*
Arduino Yún       16Mhz AVR + 400Mhz MIPS ==>   707 ms*
Intel Galileo     400Mhz x86              ==>   192 ms*

This is as far as he has gone with it but is in the process of setting up a test server to work on seeing how close to a full ssl/https implementation he can pull off.

  • 1
    Could you please put the most interesting details from the link you posted so that readers can see right away if it is worth reading further or not? Otherwise your answer would not follow SE policies and would have to be closed. – jfpoilpret Feb 6 '15 at 6:00
2

As Federico Fissore says above, the Yún can only handle HTTPS (or SSL, whatever you want to call it) on the Linux side of the Yún.

The first way to do it is using Python with Python OpenSSL. The way you do this is by issuing the following commands via SSH or YunSerialTerminal:

opkg update
opkg install python-openssl

opkg update will make sure the package list is up-to-date, and then opkg install installs Python OpenSSL. And then you can talk to the Arduino using Python. This page on the Arduino website should help you in using Python with Arduino.

You could also use curl with the -k option in your sketch. For example:

Process process;
process.runShellCommand("curl -k http://example.net");
while(p.running()); // this waits for the command to be done before continuing

Also, if you want to download a file, you could use wget. This would require you to upgrade wget by again issuing these commands via SSH or YunSerialTerminal:

opkg update
opkg upgrade wget

And then you can just do this in your sketch:

Process process;
process.runShellCommand("wget http://example.net");
while(p.running()); // this waits for the command to be done before continuing
  • is it also possible using Arduino Yún Shield ? instead of Arduino Yún ! – Ciasto piekarz Jan 31 '17 at 18:05
1

Using of WiFi shield can be a solution - it supports HTTPS.

https://www.arduino.cc/en/Reference/WiFi101

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.