mirror of https://github.com/arendst/Tasmota.git
Updated AWS IoT (markdown)
parent
918271b2d6
commit
446f85e128
41
AWS-IoT.md
41
AWS-IoT.md
|
@ -183,7 +183,7 @@ Type the following command:
|
|||
|
||||
```
|
||||
TLSKey
|
||||
xx:xx:xx MQT: stat/sonoff/RESULT = {"TLSKey1":-1,"TLSKey2":-1}
|
||||
hh:mm:ss MQT: stat/sonoff/RESULT = {"TLSKey1":-1,"TLSKey2":-1}
|
||||
```
|
||||
|
||||
If both values are `-1`, it means it does not contain any key.
|
||||
|
@ -192,6 +192,45 @@ If you need to reset the key store, use the command `TLSKey 0`.
|
|||
|
||||
#### b. Convert the Private Key
|
||||
|
||||
We will extract the 32 bytes Private key from `tasmota-01.key` generated above.
|
||||
|
||||
Simple method, use the following command: (fake key below)
|
||||
|
||||
`openssl ec -in tasmota-01.key -inform PEM -outform DER | openssl asn1parse -inform DER | head -3 | tail -1 | awk -F':' '{ print $4 }' | xxd -r -p | base64 | echo "TLSKey1 $(</dev/stdin)"`
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
openssl ec -in tasmota-01.key -inform PEM -outform DER | openssl asn1parse -inform DER | head -3 | tail -1 | awk -F':' '{ print $4 }' | xxd -r -p | base64 | echo "TLSKey1 $(</dev/stdin)"
|
||||
read EC key
|
||||
writing EC key
|
||||
TLSKey1 UvBgyCuPr/lKSgwumf/8o/mIsKQPBHn3ZZAGZl4ui9E=
|
||||
```
|
||||
|
||||
Cut and paste the command starting with `TLSKey1 ...` into the Tasmota Web Console or through MQTT.
|
||||
|
||||
```
|
||||
hh:mm:ss CMD: TLSKey1 UvBgyCuPr/lKSgwumf/8o/mIsKQPBHn3ZZAGZl4ui9E=
|
||||
hh:mm:ss MQT: stat/sonoff/RESULT = {"TLSKey1":32,"TLSKey2":-1}
|
||||
```
|
||||
|
||||
If it does not work, use the following:
|
||||
|
||||
```
|
||||
openssl ec -in tasmota-01.key -inform PEM -outform DER | openssl asn1parse -inform DER
|
||||
read EC key
|
||||
writing EC key
|
||||
0:d=0 hl=2 l= 119 cons: SEQUENCE
|
||||
2:d=1 hl=2 l= 1 prim: INTEGER :01
|
||||
5:d=1 hl=2 l= 32 prim: OCTET STRING [HEX DUMP]:52F060C82B8FAFF94A4A0C2E99FFFCA3F988B0A40F0479F7659006665E2E8BD1
|
||||
39:d=1 hl=2 l= 10 cons: cont [ 0 ]
|
||||
41:d=2 hl=2 l= 8 prim: OBJECT :prime256v1
|
||||
51:d=1 hl=2 l= 68 cons: cont [ 1 ]
|
||||
53:d=2 hl=2 l= 66 prim: BIT STRING
|
||||
```
|
||||
|
||||
Then convert the byte stream after `[HEX DUMP]` to base64 and use it with the `TLSKey1` command.
|
||||
|
||||
### Step 9. Configure Tasmota device
|
||||
|
||||
This is the last step, you need to configure the MQTT parameters. The easiest way is through the web console.
|
||||
|
|
Loading…
Reference in New Issue