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 小时前
ISP基本框架及软硬件算法实现介绍目录
网络·接口隔离原则
繁华似锦respect1 小时前
C++ unordered_map 底层实现与详细使用指南
linux·开发语言·c++·网络协议·设计模式·哈希算法·散列表
IT 乔峰2 小时前
linux部署DHCP服务端
linux·运维·网络
Wokoo72 小时前
HTTP不同版本核心对比
网络·网络协议·tcp/ip·http·udp·ssl
在路上看风景2 小时前
7.4 KDC和CA
网络
新诺韦尔API2 小时前
手机空号检测接口对接全流程指南
大数据·网络·智能手机·api
乾元3 小时前
AI + Jinja2/Ansible:从自然语义到可执行 Playbook 的完整流水线(工程级深度)
运维·网络·人工智能·网络协议·华为·自动化·ansible
ZhengEnCi3 小时前
一次多线程同步问题的排查:从 thread_count 到 thread.join() 的踩坑之旅
python·网络协议·tcp/ip
飞行增长手记3 小时前
IP协议从跨境到物联网的场景化应用
服务器·前端·网络·安全