Closed usman-whizpool closed 3 years ago
Looking at tls-reader.js, it appears to be checking the path you supplied in your configuration and it's not a valid path to a key file.
The path is valid, files exists at path given
resolved issue with following code.
const thingShadows = awsIot.thingShadow({ keyPath: (dirname + '/cert_files/private.pem.key'), certPath: (__dirname + '/cert_files/certificate.pem.crt'), caPath: (dirname + '/cert_files/AmazonRootCA1.pem'), host: 'xxxxxxxxxx-xxxxxx-1.amazonaws.com', clientId: 'xxxxxxxx', region: 'xxxxxxx', });
I think it expect complete path to the file. appending __dirname at start of the folder path worked
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
/node_modules/aws-iot-device-sdk/common/lib/tls-reader.js:92 throw new Error(exceptions.INVALID_KEY_PATH_OPTION); ^
Error: Invalid "keyPath" option supplied.
I am having this error please help me out. I am trying to use "aws-iot-device-sdk" to control the appliances (lights , fans) in nodejs
var awsIot = require('aws-iot-device-sdk');
Thanks