Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Issue faced when using M2Mqtt client with WinRTapplication

Hi Seena,

I am not the developer of the client library for .Net and WinRT. I am trying to respond to what I know...

It seems like you are connecting to a secured endpoint of the MessageSight server.  If so, you will need to obtain the CA certificate and put it on the tablet. Then, you will need to pass the certificate object when you instantiate  the MqttClient object.  For example:

        // The path to the certificate.
       
stringcaCertPath = "caCert.cer";

       
// Load the certificate into an X509Certificate object.
       X509Certificate caCert=
newX509Certificate(caCertPath);

        client = newMqttClient(host, port, true, caCert, null, MqttSslProtocols.TLSv1_1);

Note that if the security profile for the endpoint is configured for client authentication, then you will need to load the client certificate and pass it in, e.g.
        client = newMqttClient(host, port, true, caCert, clientCert, MqttSslProtocols.TLSv1_1);

Are you connecting to MessageSight 1.2 ?  Please check out IBM Knowledge Center regarding security requirements: https://www.ibm.com/support/knowledgecenter/SSCGGQ_1.2.0/com.ibm.ism.doc/Security/se00000_.html

--
Regards,
Mike Tran



From:        "Seena Latha  Sasidharan" <Seena_Sasidharan@xxxxxxxxxxx>
To:        "paho-dev@xxxxxxxxxxx" <paho-dev@xxxxxxxxxxx>
Date:        06/20/2016 06:10 AM
Subject:        [paho-dev] Issue faced when using M2Mqtt client with WinRT        application
Sent by:        paho-dev-bounces@xxxxxxxxxxx




Hi,
 
I need to connect to IBM MessageSight  Server from WinRT application.
Downloaded the M2Mqtt source project and referred in my application.
 
Client is initialized as
client = newMqttClient(host, port,false);
 
Connect method is called as
client.Connect(clientId, userName, token, true, 10);
 
An exception saying “An existing connection was forcibly closed by the remote host” is thrown.
This happens in the Receive(byte[] buffer, inttimeout) method of MqttNetworkChannelclass.
 
If client is initialzed with secure parameter set to true MqttClient(host, port,true) the below exception is thrown.
“A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider”
 
This I got when I debugged the MqttClient. For WinRT application do we need a CA certificate to be installed on client?
 
What am I missing? For WinRT is there a way to ignore certificate and  connect to the server.
Please help. I have already spend couple of days with this issue and now it has become a blocker for me to proceed with my application implementation.
 
Please let me know what is the right approach when connecting to IBM MessageSight from a Windows 8.1 app on tablet using the Paho client.
 
Thanks in advance.
 
Regards,
Seena L.S.
 _______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev



Back to the top