iphone - Use ssl server with mqttkit in ios -
i using mqttkit chat in iphone application.can me in making connection of mqttkit ssl server.
i using library https://github.com/jmesnil/mqttkit
it works fine problem want use ssl server.
i using following method :-
mosquitto_username_pw_set(mosq, cstrusername, cstrpassword); mosquitto_reconnect_delay_set(mosq, self.reconnectdelay, self.reconnectdelaymax, self.reconnectexponentialbackoff); if (mosquitto_tls_set(mosq, [cafile cstringusingencoding:nsutf8stringencoding], null, [clientfile cstringusingencoding:nsutf8stringencoding], [clientkeyfile cstringusingencoding:nsutf8stringencoding], null)) { nslog(@"error setting tls"); } mosquitto_connect(mosq, cstrhost, self.port, self.keepalive); dispatch_async(self.queue, ^{ logdebug(@"start mosquitto loop on %@", self.queue); mosquitto_loop_forever(mosq, -1, 1); logdebug(@"end mosquitto loop on %@", self.queue); });
the method 'mosquitto_tls_set' return error. can please me reslove problem have stuck in last week.
thanks in advance.
Comments
Post a Comment