-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
It is has been a little while since I've brought-up an AWS client. The configuration is complex because you need both the AWS site certificate and the client certificate pieces. Here's an example of making a secure MQTT connection to AWS with a device key & certificate. new MQTT({
host,
id,
port: 8883,
Socket: SecureSocket,
secure: {
cache: false,
protocolVersion: 0x303,
certificate: new Resource("AmazonRootCA1.der"),
clientKey: new Resource("device.key.der"),
clientCertificates: [new Resource("device.crt.a.der"), new Resource("device.crt.b.der")],
verify: true,
trace: true
},
}); Note: This example shows two client certificates for completeness. However, in most situations you will have one. Note: all the certificates and keys need ot be in DER format. If you have them in PEM format, they need to be converted to DER. That can be done with openssl. (The Moddable SDK contains a function to convert PEM to DER but an off-line conversion is preferred whenever possible). |
Beta Was this translation helpful? Give feedback.
It is has been a little while since I've brought-up an AWS client. The configuration is complex because you need both the AWS site certificate and the client certificate pieces. Here's an example of making a secure MQTT connection to AWS with a device key & certificate.
Note: This example shows two client certificates for completeness. However, in most situa…