I am trying to create self signed X.509 certificate to use in AWS IoT. I could understand that it is not different than normal OpenSSL certificate, but i stumbled on the PEM file which AWS creates is something different. Since i am new to OpenSSL i could not figure out what i am missing
I used the below command to create private key, CSR, and server certificate
openssl req -newkey rsa:2048 -new -nodes -keyout key.pem -out csr.pem
openssl x509 -req -days 365 -in csr.pem -signkey key.pem -out server.crt
If i upload csr.pem in AWS IoT console it accepts, but i could not use this file to connect MQTT.
If i upload server.crt in AWS IoT it complains that its not in CSR format it is understandable.
What wonders me is once i upload csr.pem in AWS IoT console, i could download a file xxxx.pem.crt from the console. This file works perfectly when i use to connect to MQTT. I am not sure how to create this file.
My use case is not to depend on AWS to generate this file.
Reference: http://docs.aws.amazon.com/iot/latest/developerguide/identity-in-iot.html