iOS MQTT mosquitto_tls_set method

Asked by Srivatsav Uppu

Hi Roger,

I am new to the MQTT coding. I am currently working on an iPhone app which connects to a MQTT broker. I use the mosquito library to perform MQTT functions. Now I have to make make a SSL connection to the broker. I have been given the .crt file of the server. The mosquitto_tls_set method is asking for 3 parameters. CAFILE, CERTFILE and KEYFILE. I am getting confused with the details mentioned in the link (http://mosquitto.org/man/mosquitto-tls-7.html).
I am assuming the CERTFILE is the .crt file of the server which is provided to me.
In an iPhone app how do I provide the CAFILE and KEYFILE.

Please help me with this.

Thanks,
Srivatsav

Question information

Language:
English Edit question
Status:
Answered
For:
mosquitto Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Roger Light (roger.light) said :
#1

mosquitto_tls_set() only requires cafile to be set, assuming you are only using server side certificates. certfile and keyfile are for the client side certificate (this is described in the function description).

I would respectfully suggest that you may wish to read up on SSL in general because this is not something unique to MQTT and is important to understand properly, otherwise you may well end up creating something insecure.

Can you help with this problem?

Provide an answer of your own, or ask Srivatsav Uppu for more information if necessary.

To post a message you must log in.