SmingHub / Sming

Sming - powerful open source framework simplifying the creation of embedded C++ applications.
https://sming.readthedocs.io
GNU Lesser General Public License v3.0
1.48k stars 348 forks source link

question: AWS IOT root certificate #2501

Open calvernaz opened 2 years ago

calvernaz commented 2 years ago

Hi, we are looking into the sming framework and specifically the MQTT implementation to connect the device to AWS IoT Core and in order for that communication to be successful, we need to set up TLS and the root authority certificate. We can’t find the correct API to assign a root certificate to the session. Do you have an example of how to do it?

The example you provide in the repository doesn't seem to use the authority certificate from Amazon, even though they are in the repo but no references to it.

slaff commented 2 years ago

@calvernaz We have a sample that is demonstrating the use of Amazon AWS. The keys and certificates are loaded in application.cpp lines 14 until 16.

https://github.com/SmingHub/Sming/blob/develop/samples/Basic_AWS/app/application.cpp#L14-L16

And then assigned in line 23:

https://github.com/SmingHub/Sming/blob/develop/samples/Basic_AWS/app/application.cpp#L23

The files are in the files/ directory of the sample and they MUST be in the binary DER format and not in text readable PEM format.

calvernaz commented 2 years ago

Hi @slaff thanks for the quick response, but so I totally understand, in those code bits I only see the use of the private key and the certificate and no use of the root certificate (AmazonRootCA1.pem.der).