|
1 |
| -## Working example for ESP32: https://github.com/copercini/esp32-iot-examples/ |
2 |
| --------------------------------------------------------------------------------------------- |
3 |
| - |
4 |
| - |
5 | 1 | # Some examples using x.509 certificates and TLSv1.2 under Arduino IDE to communicate with AWS iot
|
6 | 2 |
|
7 | 3 | After AxTLS update to v2.0.0, the ESP8266 can work with TLS v1.2, the major restriction for this small device communicates with AWS iot natively. You can follow the port here: https://github.com/igrr/axtls-8266
|
8 | 4 |
|
9 |
| -Due heap limitation, the ESP8266 is rebooting before complete handshake, I am hopeful it can be fixed with some optimization. |
10 | 5 |
|
11 |
| -## How I can get TLS v1.2 working in my ESP8266 with arduino IDE? |
12 |
| - |
13 |
| -#### First: Update libaxtls.a to last version (b20140f) |
14 |
| -You can compile it as you own: add xtensa toolchain to your path, and run make. <br /> |
15 |
| -Or download a compiled one in the folder axtls of this git and replace it on Arduino\hardware\esp8266com\esp8266\tools\sdk\lib of your Arduino git installation (https://github.com/esp8266/Arduino#using-git-version) |
| 6 | +## How I can get AWS IoT working in my ESP8266 with arduino IDE? |
16 | 7 |
|
| 8 | +#### First: Update ESP8266 Arduino core to last git version, [Here are the instructions](https://github.com/esp8266/Arduino#using-git-version) |
17 | 9 |
|
18 | 10 | #### Second: Creating a thing, Downloading and converting AWS iot certificates to DER format
|
19 | 11 | http://docs.aws.amazon.com/iot/latest/developerguide/create-device-certificate.html
|
20 | 12 |
|
21 | 13 | Converting PEM to DER format: <br />
|
22 |
| -$ wget https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem > ca.crt <br /> |
23 |
| -$ openssl x509 -in ca.crt -out certificates/ca.der -outform DER <br /> |
24 |
| -$ openssl x509 -in aaaaaaaaa-certificate.pem.crt -out certificates/cert.der -outform DER <br /> |
25 |
| -$ openssl rsa -in aaaaaaaaaa-private.pem.key -out certificates/private.der -outform DER <br /> |
| 14 | +$ openssl x509 -in aaaaaaaaa-certificate.pem.crt.txt -out cert.der -outform DER <br /> |
| 15 | +$ openssl rsa -in aaaaaaaaaa-private.pem.key -out private.der -outform DER <br /> |
26 | 16 |
|
| 17 | +copy cert.der and private.der to data folder |
27 | 18 |
|
28 | 19 | #### Third: Uploading a arduino sketch
|
29 | 20 | Some sketch examples are available in examples folder of this git.
|
30 | 21 |
|
31 |
| - |
32 |
| -## Why it doesn't work yet? |
33 |
| -Because AxTLS doens't support the AWS ioT required cipher suites. |
34 |
| - |
35 |
| -State: receiving Server Hello (2) <br /> |
36 |
| -State: receiving Certificate (11) <br /> |
37 |
| -State: receiving Certificate Request (13) <br /> |
38 |
| -State: receiving Server Hello Done (14) <br /> |
39 |
| -State: sending Certificate (11) <br /> |
40 |
| -State: sending Client Key Exchange (16)<br /> |
41 |
| -State: sending Finished (16)<br /> |
42 |
| -Alert: handshake failure<br /> |
43 |
| -Error: SSL error 40<br /> |
44 |
| -<br /> |
45 |
| -Based on Issue: https://github.com/esp8266/Arduino/issues/2771 <br /> |
46 |
| -Means: AxTLS library doesn't support needed cipher suites <br /> |
47 |
| -<br /> |
0 commit comments