eclipse-paho / paho.mqtt.javascript

paho.mqtt.javascript
Other
1.16k stars 466 forks source link

Failed to connect to Mosquitto when using SSL/TLS over Websockets #236

Closed Bach-Nguyen-Dinh closed 3 years ago

Bach-Nguyen-Dinh commented 3 years ago

I'm using a self-signed certificate.

In mosquitto.conf:

_listener 9883 protocol websockets

cafile C:\Program Files\mosquitto\certs\ca.crt certfile C:\Program Files\mosquitto\certs\server.crt keyfile C:\Program Files\mosquitto\certs\server.key_

And in my web client:

_host = "192.168.1.105"; port = 9883;

useSSL: true_

But in Chrome, i got: WebSocket connection to 'wss://192.168.1.105:9883/mqtt' failed and on the mosquitto debug output (-v option), I get nothing.

JoseM166 commented 2 years ago

How did you solve this?