Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] Mqtt with TLS

Hi

I am using GnatMQ broker and M2Mqtt client(paho) in Azure for my IoT project to communicate with MQTT protocol supported devices. It works fine with default port 1883. 

I am trying to implement SSL/TLS  security using x509 certification in GnatMQ broker in azure worker role, I have created X509 cert for testing using Makecert and uploaded to azure portal . After deploying GnatMQ broker with ssl pot 8883, I am unable to connect from M2Mqtt client using TLS_V1 secure connection to broker. It throws 'Exception connecting to  broker'

sample code in client

 X509Certificate cert = new X509Certificate(@".pfx path", "password");

 X509Certificate clcert = new X509Certificate(@"clientcert.cer path", "password");

MqttClient client = new MqttClient(IPAddress.Parse("Ip address"),                                 MqttSettings.MQTT_BROKER_DEFAULT_SSL_PORT,true, cert, clcert, MqttSslProtocols.TLSv1_1);

Could you please let me know what are two certificate (cacert and clientcert) that client expects. I assume one is .pfx which is available in broker side and other one is client certificate (.cer).

I have read that M2mqtt support TLS/SSL in recent release. Could you please provide any reference?

Bhuwan


Back to the top