Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fleet_provisioning_with_csr expected certificate and private key saved #1874

Closed
giuspen opened this issue Aug 16, 2023 · 5 comments
Closed

Comments

@giuspen
Copy link
Contributor

giuspen commented Aug 16, 2023

The demo fleet_provisioning_with_csr is very useful, thanks for that, it is missing the generation/write to disk of device.pem.crt and private.pem.key though as I would have expected.

The documentation at https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html states The device obtains a permanent certificate and private key by using one of these options. The device will use the certificate and key for all future authentication with AWS IoT

EDIT: also discussed on https://repost.aws/questions/QUxMmTqkwGThuBkZxxvz_imQ/aws-iot-device-sdk-embedded-c-fleet-provisioning-with-csr-demo-how-to-save-private-key-and-certificate

@Skptak
Copy link
Member

Skptak commented Aug 16, 2023

Hey @giuspen thanks for reaching out about this
I'm not sure what the issue you're facing is? In fleet_provisioning_with_csr/demo_config.h:73 we state that the demo takes in a path to a certificate existing on the host file system. This is then also true for the keys that the device itself should be using, per this line.

Is the issue you're facing is that these certificates aren't being downloaded by default when building the demo? Or is it something separate?

@giuspen
Copy link
Contributor Author

giuspen commented Aug 16, 2023

Hi @Skptak thanks for answering.

The demo is working as described, it doesn't really have a bug, I'm just asking for a little help as myself and probably many others are looking at this example in order to generate physically on the filesystem a certificate and a private key unique to the device.

I do have the claim certificate on the filesystem and the claim private key, but I would expect to generate a new unique certificate and private key that I can then use for example in the mqtt mutual auth demo.

@giuspen
Copy link
Contributor Author

giuspen commented Aug 18, 2023

Related to this issue, I created the PR #1875

@Skptak
Copy link
Member

Skptak commented Aug 18, 2023

Wow thanks for submitting a PR for a new demo @giuspen! I'm going to take a look at what you've got when I can, but just wanted to say thanks for making such a large contribution to this repository 😄

@giuspen
Copy link
Contributor Author

giuspen commented Aug 18, 2023

My pleasure @Skptak to give a little contribution, it's mostly copied code from the other fleet provisioning demo anyway, just adjusted for CreateKeysAndCertificate instead of CreateCertificateCsr and added optional write to disk of key and certificate 😉

@Skptak Skptak closed this as completed Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants