arcoirislabs / cordova-plugin-mqtt

MqTT Cordova Plugin for Apache Cordova (> v3.0)
MIT License
86 stars 49 forks source link

Any news about SSL support mqtts? #37

Open bkrajendra opened 6 years ago

bkrajendra commented 6 years ago

Any news about SSL support mqtts?

bkrajendra commented 6 years ago

SSL is working fine with me without any major change. i made some change in cordova-plugin-mqtt.js Just change url to url:"ssl://mqtt.iocarehost.com" Aso uncommented : var urgx = /(^(tcp|ssl|local)&?:\/\/[^\@_?!]+[^\s]+[^\.]+\:\d{2,})/g; Also changed line no 110 to

                if (args.url.split("ssl://").length > 1) {
                    client = new Paho.MQTT.Client(args.url.split("ssl://")[1], Number(args.wsPort), args.urlPath||"/ws", args.clientId);
                }

as i only need ssl to work. It might be needed to check ssl option here and accordingly set connect function.

praveen1207 commented 5 years ago

How to add certificate can you show the working code

bkrajendra commented 5 years ago

Im not using any client side certificate. My mqtt broker only need u to specify that connection is . No need to provide any client certificate. Most broker are same way. try it.

adrianmihaila commented 5 years ago

@arcoirislabs any news about ssl support?