Closed shihuc closed 4 years ago
Please check if your certificate is correct. Self-signed certificate requires browser credit to establish HTTPS connection.
Please check if your certificate is correct. Self-signed certificate requires browser credit to establish HTTPS connection.
Thanks,
Yes, I use self-signed certficate. I am sure the certificate is correct, because I use this set of certificate (ca/cert/key) to communicate with broker in SSL mqtt protocol and it works well.
But, How do I configure to make the browser credt to establish HTTPS connection? can you show me the procedure? PS: My wss javascript client connects to the EMQX broker directly, not through nginx or ohter proxy. The ceritficate is loaded through FileReader just by file upload process, it can not work neighter, and my certifcate is PEM formate.
Sorry, does your question still exist?
Thanks for your feedback, we will close this issue, if there is any, you can reopen it.
Environment
Description
I use mqtt.js to send and receive message with websocket (ws://emqx_node:8083/mqtt), it works well. But, when i change the protocol to be wss and the port to be 8084, the ca, cert, key are configured too, the wss configured with the same ca/cert/key as the ssl ( 8883 port) configuraton, it does not work instead of error ERR_CERT_AUTHORITY_INVALID
the javascript configuration code is like below: var myca="xxxx"; var mycert="yyyy"; var mykey = "zzzz"; var options = { protocolId: 'MQTT', protocolVersion: 4, clean: true, reconnectPeriod: 1000, connectTimeout: 30 * 1000, clientId: 'emqx_mqtt_js001', username: 'shihuc', password: 'shihuc', keepalive: 50,
rejectUnauthorized: true, key: mykey, cert: mycert,
ca: myca } const sendTopic = "kkk/send"; const recvTopic = "kkk/recv"; const client = mqtt.connect('wss://10.95.200.13:8084/mqtt', options);
And, when I use the ca/cert/key which are used here to configure the MQTT,fx (PEM formated) to connect the broker ssl://10.95.200.13:8883, it works well.
What is wrong? Is the wss not available??? PS: the verification scenario is recorded with wireshark, I captured one picture like this link (https://img2018.cnblogs.com/blog/844237/201910/844237-20191012165149658-1522628072.jpg)