I've been successfully posting data on Devices ont the MQTT Gateway of SAP Cloud Platform - IoT Cockpit using Paho. Screenshots above.
- A Supplier-device_certificate.pem was downloaded from the Device and it comes with an accompanying SecretKey. This Secret Key is required for all operations with the Supplier-device_certificate.pem file.
- I converted the Supplier-device_certificate.pem to SupplierClient.ks using openSSL.
- Certificate.ks was provided to Paho, along with the SecretKey. CAcert was also provided along with a static password -'changeit'.
This configuration works and I'm able to post data on the Device.
Now, I'm trying to replicate the connection on Node-Red. It looks similar but there are major differences.
There are no notable differences on the server credentials. The Certificates are interesting here.
- I've split the Supplier-device_certificate.pem (downloaded from the Device on SAP IOT Cockpit) into Supplier.crt and Supplier.key.
- These two Certificate and Key files have been uploaded on the TLS Config of the node along with the CAcert file. However, there is no place to provide the SecretKey for the Supplier.key. Similarly, I'm unable to find a place for providing the password for CAcert.
With this set-up, the connection fails to establish. I also get this error.
msg : error
"Error: error:0906D06C:PEM routines:PEM_read_bio:no start line"
I've already tried the following approaches.
- Use the .pem files in both Certificate and Key. - "Error: error:0907B068:PEM routines:PEM_READ_BIO_PRIVATEKEY:bad password read"
- Removing the password from the the Certificate using Open SSL - No errors displayed, but not connected
- Providing both Certificate and Key in one file. "No certificate/key file provided"
I suppose there must be a way to provide the SecretKey along with the Certificate. Any ideas?