Skip to content

Unable to build connection cloud connection in Node.js using aws-iot-device-sdk-js-v2 package #355

Discussion options

You must be logged in to vote

Answer:
I'm not 100% sure this is the issue, but the new_mtls_builder_from_path function needs the file paths to the key and cert files, not the data in the files themselves. I think removing fs.readFileSync from initializeCloud may help, as then you will be passing the file path to the key and cert. If you want to pass the file data directly (using fs.readFileSync or otherwise), then you need to use the new_mtls_builder function.
The same applies for the CA file: you either will need to pass the file path or adjust the function to with_certificate_authority.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@github-actions
Comment options

Answer selected by github-actions
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants