EMQX配置 ssl 和 wss

修改配置文件 emqx.conf,增加如下内容:

shell 复制代码
listeners.ssl.default {
  bind = "0.0.0.0:8883"
  max_connections = 512000
  ssl_options {
    keyfile = "/etc/emqx/certs/domain.key"
    certfile = "/etc/emqx/certs/domain.pem"
    cacertfile = "/etc/emqx/certs/domain.pem"
    #verify = verify_peer
    #fail_if_no_peer_cert = true
  }
}


listeners.wss.default {
  bind = "0.0.0.0:8084"
  max_connections = 512000
  websocket.mqtt_path = "/mqtt"
  ssl_options {
    keyfile = "/etc/emqx/certs/domain.key"
    certfile = "/etc/emqx/certs/domain.pem"
    cacertfile = "/etc/emqx/certs/domain.pem"
  }
}

保存并退出,重启 emqx 服务。

注意:这里的 domain.key 和 domain.pem 是商用 ssl 证书的 key 和pem,自己生成的可能有其他格式,对应修改即可。
*********************************只要思想不滑坡,办法总比困难多*********************************

相关推荐
虎头金猫1 天前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
wuyk5551 天前
《WiFi 嵌入式物联网开发全套实战》| 第 16 章 ESP32 AP+STA 双模共存原理与工程坑点
网络·stm32·物联网
XUEYUAN52121 天前
ASN 自治系统号风控:平台如何通过 IP 所属自治域批量识别代理流量
python·网络协议·http·网络安全·socks5
QYRdata1 天前
年均增速24.2%!机器人数据湖未来六年增长动能强劲
网络·机器人·服务发现
CHENKONG_CK1 天前
破解制鞋打磨痛点:RFID赋能去毛刺工序自动化升级
网络·单片机·嵌入式硬件·网络协议·tcp/ip
chshang19921 天前
工业路由器是什么?浅谈5G工业网络中的IR602
网络·物联网·5g·智能路由器
萧瑟余晖1 天前
Netty 核心组件与 Reactor 模型详解
网络·架构
ITxiaobing20231 天前
IP 定位服务选型指南:从准确率到工程落地的技术考察
linux·服务器·网络
wuyk5551 天前
【Socket 进阶之路】第 9 章 Linux 网络服务量产稳定性优化|心跳保活、TIME_WAIT、SO_LINGER、内存池、断线重连、完整异常防护框架
linux·服务器·开发语言·网络·物联网
z落落1 天前
C#UDP+串口服务端+UDP 客户端(含 CRC16 校验)
网络·网络协议·udp