Search code examples
amazon-web-servicescertificatessl-certificatex509certificate2handshake

TLS Handshaking says Certificates created by AWS IoT Console are invalid


I have created a certificate at AWS IoT Console. When I run the certificates in an AWS sample on a Raspberry Pi, everything works well. My certificates are embedded into code for testing purposes, I use mbedtls_x509_crt_parse function to parse the certificates.

Now, I want to run the application on an MCU, but getting -2700 error during the handshake. I am using the same certificates embedded into code but I get the error.

Everything seems identical between the Raspberry Pi and the MCU project. Only there is no time definition on the MCU (MBEDTLS_HAVE_TIME_DATE commented out).

I am using the mbedtls_wrapper.c implementation from the AWS IoT SDK implemented by mbedTls. I am getting"! The certificate is not correctly signed by the trusted CA" warning when I try to verify the certificates. Problem is that I did not create the certificates, AWS did, and I am using the same certificates but getting this.

I am not an expert on this? Thank you


Solution

  • Thanks Chun, Yes, I parsed the Root CA and chained with my certificate.

    In my case, it seems it is about the memory. It is a small system, KBs of RAM. I just increased the Heap Size and worked. I would expect mbedtls to give a specific error if there is no sufficient memory. Thanks.