listeners.ssl.conf.example 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. ##--------------------------------------------------------------------
  2. ## SSL Listener
  3. ##
  4. ## Add a SSL Listener
  5. ##--------------------------------------------------------------------
  6. ## Note: This is an example of how to configure this feature
  7. ## you should copy and paste the below data into the emqx.conf for working
  8. ## The SSL listener also supports all the fields listed in listeners.tcp.conf.example
  9. ## only the SSL-specific fields are shown here
  10. ## Note: Modifying the 'sslname' to what you need
  11. listeners.ssl.sslname {
  12. ## Port or Address to listen on, 0 means disable
  13. bind = 8883 ## or with an IP e.g. "127.0.0.1:8883"
  14. enabled = true
  15. acceptors = 16
  16. enable_authn = true
  17. max_connections = infinity
  18. mountpoint = ""
  19. proxy_protocol = false
  20. proxy_protocol_timeout = 3s
  21. tcp_options {
  22. active_n = 100
  23. backlog = 1024
  24. buffer = 4KB
  25. high_watermark = 1MB
  26. keepalive = none
  27. nodelay = true
  28. reuseaddr = true
  29. send_timeout = 15s
  30. send_timeout_close = true
  31. }
  32. ssl_options {
  33. ## Trusted PEM format CA certificates bundle file
  34. cacertfile = "data/certs/cacert.pem"
  35. ## PEM format certificates chain file
  36. certfile = "data/certs/cert.pem"
  37. ## PEM format private key file
  38. keyfile = "data/certs/key.pem"
  39. ## Enable or disable peer verification
  40. verify = verify_none ## use verify_peer to enable
  41. ## if `verify' is enabled, whit true, the connection fails if the client does not have a certificate to send
  42. fail_if_no_peer_cert = false
  43. ## Enable TLS session reuse
  44. reuse_sessions = true
  45. ## Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path
  46. depth = 10
  47. ## Which versions are to be supported
  48. versions = [tlsv1.3, tlsv1.2]
  49. ## TLS cipher suite names
  50. ## Note: By default, all available suites are supported, you do not need to set this
  51. ciphers = ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"]
  52. ## Allows a client and a server to renegotiate the parameters of the SSL connection on the fly
  53. secure_renegotiate = true
  54. ## Log level for SSL communication
  55. ## Type: emergency | alert | critical | error | warning | notice | info | debug | none | all
  56. log_level = notice
  57. ## Hibernate the SSL process after idling for amount of time reducing its memory footprint
  58. hibernate_after = 5s
  59. ## Forces the cipher to be set based on the server-specified order instead of the client-specified order
  60. honor_cipher_order = true
  61. ## Setting this to false to disable client-initiated renegotiation
  62. client_renegotiation = true
  63. ## Maximum time duration allowed for the handshake to complete
  64. handshake_timeout = 15s
  65. ocsp {
  66. enable_ocsp_stapling = false
  67. responder_url = "http://ocsp.example.com"
  68. issuer_pem = true
  69. refresh_http_timeout = 15s
  70. refresh_interval = 5m
  71. }
  72. }
  73. }