环境
- EMQX 版本:5.0
- 操作系统版本:CentOS7.9
重现此问题的步骤
- 按照官方文档开启ssl/tls连接
EMQX 启用双向 SSL/TLS 安全连接 | EMQ - 并生成自签证书和开启双向认证
- 客户端通过https打开后,提示: 您的连接不是私密连接
4.我在客户端安装了生成的证书,链接依然打不开。
总结:问题就是无法使用https打开,而http可以
listeners.ssl.default {
bind = “0.0.0.0:8883”
max_connections = 512000
ssl_options {
#verify = verify_peer
#fail_if_no_peer_cert = true
#keyfile = “/etc/emqx/certs/key.pem”
#certfile = “/etc/emqx/certs/cert.pem”
#cacertfile = “/etc/emqx/certs/cacert.pem”
keyfile = “/etc/emqx/certs/emqx.key”
certfile = “/etc/emqx/certs/emqx.pem”
cacertfile = “/etc/emqx/certs/ca.pem”
}
}
dashboard {
listeners.http {
bind = 18083
}
default_username = “admin”
default_password = “public”
authorization {
deny_action = ignore
no_match = allow
cache = { enable = true }
sources = [
{
type = file
enable = true
预期行为
应该产生的结果(我想要达到的目的):使用https打开此网站
实际行为
使用mqttx选择相应证书后可连接成功
实际此网站无法打开,请查看以下日志
日志:
2023-05-15T14:52:34.433550+08:00 [error] supervisor: ‘esockd_connection_sup - <0.2263.0>’, errorContext: connection_shutdown, reason: {ssl_error,{tls_alert,{certificate_unknown,“TLS server: In state wait_finished received CLIENT ALERT: Fatal - Certificate Unknown\n”}}}, offender: [{pid,<0.3217.0>},{name,connection},{mfargs,{emqx_connection,start_link,[#{enable_authn => true,limiter => #{bytes_in => #{capacity => 1099511627776,initial => 0,rate => infinity},client => #{bytes_in => #{capacity => 1099511627776,divisible => false,failure_strategy => force,initial => 0,low_watermark => 0,max_retry_time => 10000,rate => infinity},connection => #{capacity => 1099511627776,divisible => false,failure_strategy => force,initial => 0,low_watermark => 0,max_retry_time => 10000,rate => infinity},message_in => #{capacity => 1099511627776,divisible => false,failure_strategy => force,initial => 0,low_watermark => 0,max_retry_time => 10000,rate => infinity},message_routing => #{capacity => 1099511627776,divisible => false,failure_strategy => force,initial => 0,low_watermark => 0,max_retry_time => 10000,rate => infinity}},connection => #{capacity => 1000,initial => 0,rate => 100.0},message_in => #{capacity => 1099511627776,initial => 0,rate => infinity},message_routing => #{capacity => 1099511627776,initial => 0,rate => infinity}},listener => {ssl,default},zone => default}]}}]