Skip to content

Instantly share code, notes, and snippets.

@zmstone
Last active October 3, 2023 15:53
Show Gist options
  • Save zmstone/1c85eeaae20f7f5745ee92e288921b0e to your computer and use it in GitHub Desktop.
Save zmstone/1c85eeaae20f7f5745ee92e288921b0e to your computer and use it in GitHub Desktop.
EMQX v5 add a new zone and link a SSL listener to it
## Verified in EMQX 5.3.0
## listeners in addition to the default ones
listeners {
ssl.certhash {
enable = true
# bind to port 8884
bind = 8884
# link it to zone named 'certhash'
zone = certhash
ssl_options {
# force the clients to send certificate
verify = verify_peer
fail_if_no_peer_cert = true
}
}
}
## zones in addition to 'default'
zones {
# the new zone is named 'certhash'
certhash {
mqtt {
# md5 hash of the DER format (but not PEM) of the client X.509 certificate
peer_cert_as_username = md5
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment