Im using Mosquitto 2.0.14 and running broker in my local system.(Broker + publisher + subscriber).
I created the required certs(ca, broker-server, client). Below is my simple configuration for WSS connection.
allow_anonymous true
password_file C:\Mosquitto\password.txt
listener 1883
protocol mqtt
cafile C:\Mosquitto\certs\ca.crt
keyfile C:\Mosquitto\certs\server.key
certfile C:\Mosquitto\certs\server.crt
listener 8883
protocol websockets
cafile C:\Mosquitto\certs\ca.crt
keyfile C:\Mosquitto\certs\server.key
certfile C:\Mosquitto\certs\server.crt
tls_version tlsv1.2
log_type all
websockets_log_level 1023
connection_messages true
With the above configuration, im able to connect to plain MQTT. But tried to connect with WSS.
Im using Javascript client(html) and paho & mqtt.js client to connect to MQTT broker with WSS protocol. But its failing.
mqttws31.js:979 WebSocket connection to ‘wss://myLaptop:8084/mqtt’ failed:
Not able to connect with mosquitto_pub and mosquitto_sub.
Not sure what im missing.
Any suggestion would help.