Trouble with uploading Ca Certificate for MQTT broker

Solved
marcus_kisi
Conversationalist

Trouble with uploading Ca Certificate for MQTT broker

Hi, according to the doumentation for the creation of MQTT broker in https://developer.cisco.com/meraki/api-v1/create-network-mqtt-broker/, we can specify the `caCertificate` field. However, I am not able to find the correct format which the meraki API accepts via the api call. I have tried indicating new lines via \n and \\n, but have had no success with getting the meraki API to accept it. Uploading the same certificate through the Meraki Dashboard works however. 

 

Has anyone had any success with using the API to upload their certificate? Thanks!

1 Accepted Solution
marcus_kisi
Conversationalist

Hi @JosRus

I was doing some testing, and I figured out that it was working with the nextline character \n, and I was actually having a bug with the saving of the certificate in the dashboard! I was able to receive the MQTT messages with the certificate as"-----BEGIN CERTIFICATE\n-----ECgwDQVdTM...\n-----END CERTIFICATE-----" , just that when I was trying to verify that it was correctly saved in the dashboard, it was showing an error. I'll mark the question as resolved as well! Thanks for the response!

View solution in original post

2 Replies 2
JosRus
Meraki Employee
Meraki Employee

Hi @marcus_kisi!

You should be able to remove any newline characters as I believe they are not necessary for the functionality of the string, just for readability. Try entering the text as one long string with any /n or other newlines removed, such as "-----BEGIN CERTIFICATE-----ECgwDQVdTM...-----END CERTIFICATE-----" 

 

Let me know of the outcome too!

If you found this post helpful, please give it kudos. If my answer solved your problem, click "accept as solution" so that others can benefit from it.
marcus_kisi
Conversationalist

Hi @JosRus

I was doing some testing, and I figured out that it was working with the nextline character \n, and I was actually having a bug with the saving of the certificate in the dashboard! I was able to receive the MQTT messages with the certificate as"-----BEGIN CERTIFICATE\n-----ECgwDQVdTM...\n-----END CERTIFICATE-----" , just that when I was trying to verify that it was correctly saved in the dashboard, it was showing an error. I'll mark the question as resolved as well! Thanks for the response!

Get notified when there are additional replies to this discussion.