Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » paho mqtt-ssl client not working
paho mqtt-ssl client not working [message #1752056] Wed, 18 January 2017 11:38 Go to next message
alice alex is currently offline alice alexFriend
Messages: 5
Registered: January 2017
Junior Member
I created paho mqtt client with following options
MQTTClient_SSLOptions ssl_opts = MQTTClient_SSLOptions_initializer;
    int rc;
    MQTTClient_create(&client, "ssl://localhost:8883",CLIENTID,MQTTCLIENT_PERSISTENCE_NONE, NULL);
    conn_opts.ssl = &ssl_opts;
    conn_opts.ssl->keyStore = "/home/certs/php-client-chain.pem";
    conn_opts.ssl->privateKeyPassword = "password";
    conn_opts.ssl->enabledCipherSuites = "DEFAULT";
    conn_opts.ssl->enableServerCertAuth = 0;
     MQTTClient_setCallbacks(client, NULL, connlost, msgarrvd, delivered);
    if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS)
        printf("Failed to connect, return code %d\n", rc);

When I executed the code I am getting failed to connect error return code -1.Nothing is displayed in the broker's log file.
Re: paho mqtt-ssl client not working [message #1759127 is a reply to message #1752056] Thu, 06 April 2017 09:04 Go to previous message
Ian Craggs is currently offline Ian CraggsFriend
Messages: 76
Registered: March 2013
Make sure you link with the SSL enabled version of the library. These end with 's' - such as paho-mqtt3cs
Previous Topic:Why python sdk of mqtt needs pem file, while java sdk not?
Next Topic:Connect to Azure IOT hub using X509 Certificate
Goto Forum:

Current Time: Sat Oct 24 21:25:02 GMT 2020

Powered by FUDForum. Page generated in 0.01198 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top