MQTT over wss CONNACK error


I’m connecting to losant over MQTT using a raspberry pi with MQTT Paho C. I can successfully connect over tcp, tls, and ws, but not wss.

The SSL negotiation succeeds, but I get the message “WebSocket upgrade read not complete”. When I connect over ws, this websocket upgrade does succeed.

After the SSL negotiation, it sends a connect message, but instead of getting a CONNACK I receive:

<- PUBACK msgid: 21584
<- PUBCOMP msgid: 25701
<- PUBREL msgid 8301
then my side sends a -> PUBCOMP msgid 8301

then the connect fails.

The Root certificate seems to be correct, I’ve tried both default and downloading your root-CA, and both give the same result. I’ve also set the username/password correctly, as it works over the other 3 methods.

hostname: wss://
clientID: deviceID
topic: losant/deviceID/state
username: my_username
password: my_password

The only thing I really change between all 4 methods is the hostname, but for whatever reason it doesn’t work for wss. I have no firewalls installed on the pi, and the router isn’t blocking http traffic.

Have you ever seen something like this before? Or have any ideas on what might be causing this?

Hey @Terry_Stasiuk,

I’m doing some testing on my end. I was able to get the secure WebSocket working for other clients (to ensure that it’s working properly ). I’m now doing some testing with the Paho MQTT C library to see if I can reproduce the behavior!

Sounds good. The wss connection with my settings does work if I use like a javascript client in a browser or such, but using the Pi with Paho C I can’t seem to get it to work.

Thanks for looking into it.