-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Hi, guys. I want to use two-way authentication when connecting using WebSocket, but when I use the client certificate, it shows that the connection has failed, so I would like to ask how to use TLS/SSL two-way authentication in the browser?
I am very sorry for the disturbance, I would be very grateful.
Currently, I am configuring the contents of the ca, cert and key files directly into options in the code, but I can't use them, unlike when using TCP connections.
const { host, port, endpoint, ...options } = this.connection
options.rejectUnauthorized = true
options.ca = certs.ca
options.cert = certs.sert
options.key = certs.key
const connectUrl = `wss://${host}:${port}${endpoint}`
this.client = mqtt.connect(connectUrl, options)Because I tested it, it will connect fine if I don't use WebSocket.
The only error message I get is that the connection failed. I think it's an error when creating a new WebSocket client.
Metadata
Metadata
Assignees
Labels
No labels
