haproxy负载 ssl证书配置好 wss连接时 mqttx可以连接 前端连接不上

haproxy负载 ssl证书配置好 wss连接时 mqttx可以连接 前端连接不上
haproxy配置
listen mqtt-wss
bind *:8084 ssl crt /etc/ssl/emqx/emq.pem no-sslv3
mode tcp
maxconn 50000
timeout client 600s
default_backend emqx_cluster_wss

backend emqx_cluster_wss
mode tcp
balance source
timeout server 50s
timeout check 5000
server emqx1 127.0.0.1:9083 check inter 10000 fall 2 rise 5 weight 1
server emqx2 172.26.230.162:8083 check inter 10000 fall 2 rise 5 weight 1

使用mqttx 这个工具可以通过wss连上
前端vue创建连接的时候 连不上

一般都是 TLS 配置的问题,可以看下连接失败时 EMQX 后台日志有没有输出什么信息。

emqx后台日志没看到信息
在haproxy日志中看到
mqtt-wss/1: SSL handshake failure

你是在 LB 这边直接把 TLS 连接卸载了是吧。我看了下你好像没有在 HAProxy 中配置证书的私钥?另外你用前段 Vue 连接时有没有指定信任的根 CA 证书?

你也可以先看下这篇博客,了解下 TLS 的一些必须配置: EMQX TLS 使用配置指南

做了卸载 证书的私钥配置在一起的