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,自己生成的可能有其他格式,对应修改即可。
*********************************只要思想不滑坡,办法总比困难多*********************************

相关推荐
乐迪信息2 分钟前
乐迪信息:AI防爆摄像机在船舶监控的应用
大数据·网络·人工智能·算法·无人机
天天睡大觉25 分钟前
Python学习12
网络·python·学习
i建模25 分钟前
如何设置宿主的windows11系统访问HyperV的虚拟机,同时该虚拟机可以上网
网络
陌上花开缓缓归以1 小时前
Linux 5.4内核版本内核宏梳理
linux·网络·github
hjhcos1 小时前
【宝塔】局域网IP申请SSL证书,解决浏览器本地环境可以访问摄像头,发布环境不能访问摄像头的问题
网络协议·tcp/ip·ssl
idontknow2332 小时前
DPDK学习笔记(1):二层转发应用例代码解析
c语言·网络·笔记·学习
2301_803554523 小时前
阻塞,非阻塞,同步,异步以及linux上的5种IO模型阻塞,非阻塞,信号驱动,异步,IO复用
java·服务器·网络
JAVA+C语言3 小时前
多主机 TCP 通信
网络·windows·tcp/ip
Gensors传感器3 小时前
Gensors解读:TCP/IP协议在压力扫描系统中的作用详解
网络·网络协议·tcp/ip·压力测试·压力扫描阀·扫描阀
我送炭你添花3 小时前
树莓派部署 GenieACS 作为终端TR-069 ACS(自动配置服务器)的详细规划方案
运维·服务器·网络协议