Skip to content

Configuration Manual

  • listeners

    TypeStruct(listeners)

    listeners

    • tcp

      TypeMap($name->OneOf(Struct(mqtt_tcp_listener),String("marked_for_deletion")))
      Description

      TCP listeners.

      mqtt_tcp_listener

      • enable

        Aliasesenabled
        TypeBoolean
        Defaulttrue
        Description

        Enable listener.

      • bind

        TypeString
        Default1883
        Description

        IP address and port for the listening socket.

      • acceptors

        TypeInteger(1..+inf)
        Default16
        Description

        The size of the listener's receiving pool.

      • max_connections

        TypeOneOf(String("infinity"),Integer(1..+inf))
        Defaultinfinity
        Description

        The maximum number of concurrent connections allowed by the listener.

      • mountpoint

        TypeString
        Default""
        Description

        When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t.
        Set to "" to disable the feature.

        Variables in mountpoint string:

        • ${clientid}: clientid
        • ${username}: username
      • zone

        TypeString
        Defaultdefault
        Description

        The configuration zone to which the listener belongs. Clients connected to this listener will inherit zone-settings created under this zone name.

        A zone can override the configs under below root names:

        • mqtt
        • force_shutdown
        • force_gc
        • flapping_detect
        • durable_sessions
      • enable_authn

        TypeEnum(true,false,quick_deny_anonymous)
        Defaulttrue
        Description

        Set true (default) to enable client authentication on this listener, the authentication process goes through the configured authentication chain. When set to false, any client (with or without username/password) is allowed to connect. When set to quick_deny_anonymous, it behaves like when set to true, but clients will be denied immediately without going through any authenticators if username is not provided. This is useful to fence off anonymous clients early.

      • max_conn_rate

        TypeString
        Description

        Maximum connection rate.
        This is used to limit the connection rate for this node. Once the limit is reached, new connections will be deferred or refused.
        For example:

        • 1000/s :: Only accepts 1000 connections per second
        • 1000/10s :: Only accepts 1000 connections every 10 seconds.
      • messages_rate

        TypeString
        Description

        Messages publish rate.
        This is used to limit the inbound message numbers for this node. Once the limit is reached, the restricted client will slow down and even be hung for a while.
        For example:

        • 500/s :: Only the first 500 messages are sent per second and other messages are buffered.
        • 500/10s :: Only the first 500 messages are sent even 10 second and other messages are buffered.
      • bytes_rate

        TypeString
        Description

        Data publish rate.
        This is used to limit the inbound bytes rate for this node. Once the limit is reached, the restricted client will slow down and even be hung for a while.
        The unit of the bytes could be:KB MB GB.
        For example:

        • 500KB/s :: Only the first 500 kilobytes are sent per second and other messages are buffered.
        • 500MB/10s :: Only the first 500 megabytes are sent even 10 second and other messages are buffered.
      • access_rules

        TypeArray(String)
        Default["allow all"]
        Description

        The access control rules for this listener.
        See: https://github.com/emqtt/esockd#allowdeny

      • proxy_protocol

        TypeBoolean
        Defaultfalse
        Description

        Enable the Proxy Protocol V1/2 if the EMQX cluster is deployed behind HAProxy or Nginx.
        See: https://www.haproxy.com/blog/haproxy/proxy-protocol/

      • proxy_protocol_timeout

        TypeDuration
        Default"3s"
        Description

        Timeout for proxy protocol. EMQX will close the TCP connection if proxy protocol packet is not received within the timeout.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • tcp_options

        TypeStruct(tcp_opts)

        tcp_opts

        • active_n
          TypeInteger
          Default100
          Description

          Specify the {active, N} option for this Socket.
          See: https://erlang.org/doc/man/inet.html#setopts-2

        • backlog
          TypeInteger(1..+inf)
          Default1024
          Description

          TCP backlog defines the maximum length that the queue of pending connections can grow to.

        • send_timeout
          TypeDuration
          Default"15s"
          Description

          The TCP send timeout for the connections.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • send_timeout_close
          TypeBoolean
          Defaulttrue
          Description

          Close the connection if send timeout.

        • recbuf
          TypeBytesize
          Description

          The TCP receive buffer (OS kernel) for the connections.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • sndbuf
          TypeBytesize
          Description

          The TCP send buffer (OS kernel) for the connections.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • buffer
          TypeBytesize
          Default"4KB"
          Description

          The size of the user-space buffer used by the driver.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • high_watermark
          TypeBytesize
          Default"1MB"
          Description

          The socket is set to a busy state when the amount of data queued internally by the VM socket implementation reaches this limit.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • nodelay
          TypeBoolean
          Defaulttrue
          Description

          The TCP_NODELAY flag for the connections.

        • reuseaddr
          TypeBoolean
          Defaulttrue
          Description

          The SO_REUSEADDR flag for the connections.

        • keepalive
          TypeString
          Defaultnone
          Description

          Enable TCP keepalive for MQTT connections over TCP or SSL. The value is three comma separated numbers in the format of 'Idle,Interval,Probes'

          • Idle: The number of seconds a connection needs to be idle before the server begins to send out keep-alive probes (Linux default 7200).
          • Interval: The number of seconds between TCP keep-alive probes (Linux default 75).
          • Probes: The maximum number of TCP keep-alive probes to send before giving up and killing the connection if no response is obtained from the other end (Linux default 9). For example "240,30,5" means: EMQX should start sending TCP keepalive probes after the connection is in idle for 240 seconds, and the probes are sent every 30 seconds until a response is received from the MQTT client, if it misses 5 consecutive responses, EMQX should close the connection. Default: 'none'
    • ssl

      TypeMap($name->OneOf(Struct(mqtt_ssl_listener),String("marked_for_deletion")))
      Description

      SSL listeners.

      mqtt_ssl_listener

      • enable

        Aliasesenabled
        TypeBoolean
        Defaulttrue
        Description

        Enable listener.

      • bind

        TypeString
        Default8883
        Description

        IP address and port for the listening socket.

      • acceptors

        TypeInteger(1..+inf)
        Default16
        Description

        The size of the listener's receiving pool.

      • max_connections

        TypeOneOf(String("infinity"),Integer(1..+inf))
        Defaultinfinity
        Description

        The maximum number of concurrent connections allowed by the listener.

      • mountpoint

        TypeString
        Default""
        Description

        When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t.
        Set to "" to disable the feature.

        Variables in mountpoint string:

        • ${clientid}: clientid
        • ${username}: username
      • zone

        TypeString
        Defaultdefault
        Description

        The configuration zone to which the listener belongs. Clients connected to this listener will inherit zone-settings created under this zone name.

        A zone can override the configs under below root names:

        • mqtt
        • force_shutdown
        • force_gc
        • flapping_detect
        • durable_sessions
      • enable_authn

        TypeEnum(true,false,quick_deny_anonymous)
        Defaulttrue
        Description

        Set true (default) to enable client authentication on this listener, the authentication process goes through the configured authentication chain. When set to false, any client (with or without username/password) is allowed to connect. When set to quick_deny_anonymous, it behaves like when set to true, but clients will be denied immediately without going through any authenticators if username is not provided. This is useful to fence off anonymous clients early.

      • max_conn_rate

        TypeString
        Description

        Maximum connection rate.
        This is used to limit the connection rate for this node. Once the limit is reached, new connections will be deferred or refused.
        For example:

        • 1000/s :: Only accepts 1000 connections per second
        • 1000/10s :: Only accepts 1000 connections every 10 seconds.
      • messages_rate

        TypeString
        Description

        Messages publish rate.
        This is used to limit the inbound message numbers for this node. Once the limit is reached, the restricted client will slow down and even be hung for a while.
        For example:

        • 500/s :: Only the first 500 messages are sent per second and other messages are buffered.
        • 500/10s :: Only the first 500 messages are sent even 10 second and other messages are buffered.
      • bytes_rate

        TypeString
        Description

        Data publish rate.
        This is used to limit the inbound bytes rate for this node. Once the limit is reached, the restricted client will slow down and even be hung for a while.
        The unit of the bytes could be:KB MB GB.
        For example:

        • 500KB/s :: Only the first 500 kilobytes are sent per second and other messages are buffered.
        • 500MB/10s :: Only the first 500 megabytes are sent even 10 second and other messages are buffered.
      • access_rules

        TypeArray(String)
        Default["allow all"]
        Description

        The access control rules for this listener.
        See: https://github.com/emqtt/esockd#allowdeny

      • proxy_protocol

        TypeBoolean
        Defaultfalse
        Description

        Enable the Proxy Protocol V1/2 if the EMQX cluster is deployed behind HAProxy or Nginx.
        See: https://www.haproxy.com/blog/haproxy/proxy-protocol/

      • proxy_protocol_timeout

        TypeDuration
        Default"3s"
        Description

        Timeout for proxy protocol. EMQX will close the TCP connection if proxy protocol packet is not received within the timeout.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • tcp_options

        TypeStruct(tcp_opts)

        tcp_opts

        • active_n
          TypeInteger
          Default100
          Description

          Specify the {active, N} option for this Socket.
          See: https://erlang.org/doc/man/inet.html#setopts-2

        • backlog
          TypeInteger(1..+inf)
          Default1024
          Description

          TCP backlog defines the maximum length that the queue of pending connections can grow to.

        • send_timeout
          TypeDuration
          Default"15s"
          Description

          The TCP send timeout for the connections.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • send_timeout_close
          TypeBoolean
          Defaulttrue
          Description

          Close the connection if send timeout.

        • recbuf
          TypeBytesize
          Description

          The TCP receive buffer (OS kernel) for the connections.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • sndbuf
          TypeBytesize
          Description

          The TCP send buffer (OS kernel) for the connections.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • buffer
          TypeBytesize
          Default"4KB"
          Description

          The size of the user-space buffer used by the driver.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • high_watermark
          TypeBytesize
          Default"1MB"
          Description

          The socket is set to a busy state when the amount of data queued internally by the VM socket implementation reaches this limit.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • nodelay
          TypeBoolean
          Defaulttrue
          Description

          The TCP_NODELAY flag for the connections.

        • reuseaddr
          TypeBoolean
          Defaulttrue
          Description

          The SO_REUSEADDR flag for the connections.

        • keepalive
          TypeString
          Defaultnone
          Description

          Enable TCP keepalive for MQTT connections over TCP or SSL. The value is three comma separated numbers in the format of 'Idle,Interval,Probes'

          • Idle: The number of seconds a connection needs to be idle before the server begins to send out keep-alive probes (Linux default 7200).
          • Interval: The number of seconds between TCP keep-alive probes (Linux default 75).
          • Probes: The maximum number of TCP keep-alive probes to send before giving up and killing the connection if no response is obtained from the other end (Linux default 9). For example "240,30,5" means: EMQX should start sending TCP keepalive probes after the connection is in idle for 240 seconds, and the probes are sent every 30 seconds until a response is received from the MQTT client, if it misses 5 consecutive responses, EMQX should close the connection. Default: 'none'
      • ssl_options

        TypeStruct(listener_ssl_opts)

        listener_ssl_opts

        • cacertfile
          TypeString
          Default"${EMQX_ETC_DIR}/certs/cacert.pem"
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Default"${EMQX_ETC_DIR}/certs/cert.pem"
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Default"${EMQX_ETC_DIR}/certs/key.pem"
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • dhfile
          TypeString
          Description

          Path to a file containing PEM-encoded Diffie-Hellman parameters to be used by the server if a cipher suite using Diffie-Hellman key exchange is negotiated. If not specified, default parameters are used.
          NOTE: The dhfile option is not supported by TLS 1.3.

        • fail_if_no_peer_cert
          TypeBoolean
          Defaultfalse
          Description

          Used together with {verify, verify_peer} by an TLS/DTLS server. If set to true, the server fails if the client does not have a certificate to send, that is, sends an empty certificate. If set to false, it fails only if the client sends an invalid certificate (an empty certificate is considered valid).

        • honor_cipher_order
          TypeBoolean
          Defaulttrue
          Description

          An important security setting. It forces the cipher to be set based on the server-specified order instead of the client-specified order, hence enforcing the (usually more properly configured) security ordering of the server administrator.

        • client_renegotiation
          TypeBoolean
          Defaulttrue
          Description

          In protocols that support client-initiated renegotiation, the cost of resources of such an operation is higher for the server than the client. This can act as a vector for denial of service attacks. The SSL application already takes measures to counter-act such attempts, but client-initiated renegotiation can be strictly disabled by setting this option to false. The default value is true. Note that disabling renegotiation can result in long-lived connections becoming unusable due to limits on the number of messages the underlying cipher suite can encipher.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • handshake_timeout
          TypeDuration
          Default"15s"
          Description

          Maximum time duration allowed for the handshake to complete
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • gc_after_handshake
          TypeBoolean
          Defaultfalse
          Description

          Memory usage tuning. If enabled, will immediately perform a garbage collection after the TLS/SSL handshake.

        • ocsp
          TypeStruct(ocsp)

          ocsp

          • enable_ocsp_stapling
            TypeBoolean
            Defaultfalse
            Description

            Whether to enable Online Certificate Status Protocol (OCSP) stapling for the listener. If set to true, requires defining the OCSP responder URL and issuer PEM path.

          • responder_url
            TypeString
            Description

            URL for the OCSP responder to check the server certificate against.

          • issuer_pem
            TypeString
            Description

            PEM-encoded certificate of the OCSP issuer for the server certificate.

          • refresh_interval
            TypeDuration
            Default"5m"
            Description

            The period to refresh the OCSP response for the server.
            A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

          • refresh_http_timeout
            TypeDuration
            Default"15s"
            Description

            The timeout for the HTTP request when checking OCSP responses.
            A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable_crl_check
          TypeBoolean
          Defaultfalse
          Description

          Whether to enable CRL verification for this listener.

    • ws

      TypeMap($name->OneOf(Struct(mqtt_ws_listener),String("marked_for_deletion")))
      Description

      HTTP websocket listeners.

      mqtt_ws_listener

      • enable

        Aliasesenabled
        TypeBoolean
        Defaulttrue
        Description

        Enable listener.

      • bind

        TypeString
        Default8083
        Description

        IP address and port for the listening socket.

      • acceptors

        TypeInteger(1..+inf)
        Default16
        Description

        The size of the listener's receiving pool.

      • max_connections

        TypeOneOf(String("infinity"),Integer(1..+inf))
        Defaultinfinity
        Description

        The maximum number of concurrent connections allowed by the listener.

      • mountpoint

        TypeString
        Default""
        Description

        When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t.
        Set to "" to disable the feature.

        Variables in mountpoint string:

        • ${clientid}: clientid
        • ${username}: username
      • zone

        TypeString
        Defaultdefault
        Description

        The configuration zone to which the listener belongs. Clients connected to this listener will inherit zone-settings created under this zone name.

        A zone can override the configs under below root names:

        • mqtt
        • force_shutdown
        • force_gc
        • flapping_detect
        • durable_sessions
      • enable_authn

        TypeEnum(true,false,quick_deny_anonymous)
        Defaulttrue
        Description

        Set true (default) to enable client authentication on this listener, the authentication process goes through the configured authentication chain. When set to false, any client (with or without username/password) is allowed to connect. When set to quick_deny_anonymous, it behaves like when set to true, but clients will be denied immediately without going through any authenticators if username is not provided. This is useful to fence off anonymous clients early.

      • max_conn_rate

        TypeString
        Description

        Maximum connection rate.
        This is used to limit the connection rate for this node. Once the limit is reached, new connections will be deferred or refused.
        For example:

        • 1000/s :: Only accepts 1000 connections per second
        • 1000/10s :: Only accepts 1000 connections every 10 seconds.
      • messages_rate

        TypeString
        Description

        Messages publish rate.
        This is used to limit the inbound message numbers for this node. Once the limit is reached, the restricted client will slow down and even be hung for a while.
        For example:

        • 500/s :: Only the first 500 messages are sent per second and other messages are buffered.
        • 500/10s :: Only the first 500 messages are sent even 10 second and other messages are buffered.
      • bytes_rate

        TypeString
        Description

        Data publish rate.
        This is used to limit the inbound bytes rate for this node. Once the limit is reached, the restricted client will slow down and even be hung for a while.
        The unit of the bytes could be:KB MB GB.
        For example:

        • 500KB/s :: Only the first 500 kilobytes are sent per second and other messages are buffered.
        • 500MB/10s :: Only the first 500 megabytes are sent even 10 second and other messages are buffered.
      • access_rules

        TypeArray(String)
        Default["allow all"]
        Description

        The access control rules for this listener.
        See: https://github.com/emqtt/esockd#allowdeny

      • proxy_protocol

        TypeBoolean
        Defaultfalse
        Description

        Enable the Proxy Protocol V1/2 if the EMQX cluster is deployed behind HAProxy or Nginx.
        See: https://www.haproxy.com/blog/haproxy/proxy-protocol/

      • proxy_protocol_timeout

        TypeDuration
        Default"3s"
        Description

        Timeout for proxy protocol. EMQX will close the TCP connection if proxy protocol packet is not received within the timeout.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • tcp_options

        TypeStruct(tcp_opts)

        tcp_opts

        • active_n
          TypeInteger
          Default100
          Description

          Specify the {active, N} option for this Socket.
          See: https://erlang.org/doc/man/inet.html#setopts-2

        • backlog
          TypeInteger(1..+inf)
          Default1024
          Description

          TCP backlog defines the maximum length that the queue of pending connections can grow to.

        • send_timeout
          TypeDuration
          Default"15s"
          Description

          The TCP send timeout for the connections.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • send_timeout_close
          TypeBoolean
          Defaulttrue
          Description

          Close the connection if send timeout.

        • recbuf
          TypeBytesize
          Description

          The TCP receive buffer (OS kernel) for the connections.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • sndbuf
          TypeBytesize
          Description

          The TCP send buffer (OS kernel) for the connections.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • buffer
          TypeBytesize
          Default"4KB"
          Description

          The size of the user-space buffer used by the driver.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • high_watermark
          TypeBytesize
          Default"1MB"
          Description

          The socket is set to a busy state when the amount of data queued internally by the VM socket implementation reaches this limit.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • nodelay
          TypeBoolean
          Defaulttrue
          Description

          The TCP_NODELAY flag for the connections.

        • reuseaddr
          TypeBoolean
          Defaulttrue
          Description

          The SO_REUSEADDR flag for the connections.

        • keepalive
          TypeString
          Defaultnone
          Description

          Enable TCP keepalive for MQTT connections over TCP or SSL. The value is three comma separated numbers in the format of 'Idle,Interval,Probes'

          • Idle: The number of seconds a connection needs to be idle before the server begins to send out keep-alive probes (Linux default 7200).
          • Interval: The number of seconds between TCP keep-alive probes (Linux default 75).
          • Probes: The maximum number of TCP keep-alive probes to send before giving up and killing the connection if no response is obtained from the other end (Linux default 9). For example "240,30,5" means: EMQX should start sending TCP keepalive probes after the connection is in idle for 240 seconds, and the probes are sent every 30 seconds until a response is received from the MQTT client, if it misses 5 consecutive responses, EMQX should close the connection. Default: 'none'
      • websocket

        TypeStruct(ws_opts)

        ws_opts

        • mqtt_path
          TypeString
          Default"/mqtt"
          Description

          WebSocket's MQTT protocol path. By default, the full URL for the WebSocket client to connect is: ws://{ip}:{port}/mqtt. Append /[...] to the end of the path to make EMQX accept any subpath. For example, specifying mqtt/[...] would allow clients to connect at paths like mqtt/org1 or mqtt/group2, etc.

          NOTE: An unmatched path will cause the client to be rejected immediately at the HTTP layer, meaning it will not be traceable at the MQTT layer.

        • mqtt_piggyback
          TypeEnum(single,multiple)
          Defaultmultiple
          Description

          Whether a WebSocket message is allowed to contain multiple MQTT packets.

        • compress
          TypeBoolean
          Defaultfalse
          Description

          If true, compress WebSocket messages using zlib.
          The configuration items under deflate_opts belong to the compression-related parameter configuration.

        • idle_timeout
          TypeDuration
          Default"7200s"
          Description

          Close transport-layer connections from the clients that have not sent MQTT CONNECT message within this interval.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • max_frame_size
          TypeOneOf(String("infinity"),Integer)
          Defaultinfinity
          Description

          The maximum length of a single MQTT packet.

        • fail_if_no_subprotocol
          TypeBoolean
          Defaulttrue
          Description

          If true, the server will return an error when the client does not carry the Sec-WebSocket-Protocol field.
          Note: WeChat applet needs to disable this verification.

        • supported_subprotocols
          TypeString
          Default"mqtt, mqtt-v3, mqtt-v3.1.1, mqtt-v5"
          Description

          Comma-separated list of supported subprotocols.

        • check_origin_enable
          TypeBoolean
          Defaultfalse
          Description

          If true, origin HTTP header will be validated against the list of allowed origins configured in check_origins parameter.

        • allow_origin_absence
          TypeBoolean
          Defaulttrue
          Description

          If false and check_origin_enable is true, the server will reject requests that don't have origin HTTP header.

        • check_origins
          TypeString
          Default"http://localhost:18083, http://127.0.0.1:18083"
          Description

          List of allowed origins.
          See check_origin_enable.

        • proxy_address_header
          TypeString
          Default"x-forwarded-for"
          Description

          HTTP header used to pass information about the client IP address. Relevant when the EMQX cluster is deployed behind a load-balancer.

        • proxy_port_header
          TypeString
          Default"x-forwarded-port"
          Description

          HTTP header used to pass information about the client port. Relevant when the EMQX cluster is deployed behind a load-balancer.

        • deflate_opts
          TypeStruct(deflate_opts)

          deflate_opts

          • level
            TypeEnum(none,default,best_compression,best_speed)
            Description

            Compression level.

          • mem_level
            TypeInteger(1..9)
            Default8
            Description

            Specifies the size of the compression state.
            Lower values decrease memory usage per connection.

          • strategy
            TypeEnum(default,filtered,huffman_only,rle)
            Defaultdefault
            Description

            Specifies the compression strategy.

          • server_context_takeover
            TypeEnum(takeover,no_takeover)
            Defaulttakeover
            Description

            Takeover means the compression state is retained between server messages.

          • client_context_takeover
            TypeEnum(takeover,no_takeover)
            Defaulttakeover
            Description

            Takeover means the compression state is retained between client messages.

          • server_max_window_bits
            TypeInteger(8..15)
            Default15
            Description

            Specifies the size of the compression context for the server.

          • client_max_window_bits
            TypeInteger(8..15)
            Default15
            Description

            Specifies the size of the compression context for the client.

        • validate_utf8
          TypeBoolean
          Defaulttrue
          Description

          Set to false to disable WebSocket Frame UTF-8 validation for performance

    • wss

      TypeMap($name->OneOf(Struct(mqtt_wss_listener),String("marked_for_deletion")))
      Description

      HTTPS websocket listeners.

      mqtt_wss_listener

      • enable

        Aliasesenabled
        TypeBoolean
        Defaulttrue
        Description

        Enable listener.

      • bind

        TypeString
        Default8084
        Description

        IP address and port for the listening socket.

      • acceptors

        TypeInteger(1..+inf)
        Default16
        Description

        The size of the listener's receiving pool.

      • max_connections

        TypeOneOf(String("infinity"),Integer(1..+inf))
        Defaultinfinity
        Description

        The maximum number of concurrent connections allowed by the listener.

      • mountpoint

        TypeString
        Default""
        Description

        When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t.
        Set to "" to disable the feature.

        Variables in mountpoint string:

        • ${clientid}: clientid
        • ${username}: username
      • zone

        TypeString
        Defaultdefault
        Description

        The configuration zone to which the listener belongs. Clients connected to this listener will inherit zone-settings created under this zone name.

        A zone can override the configs under below root names:

        • mqtt
        • force_shutdown
        • force_gc
        • flapping_detect
        • durable_sessions
      • enable_authn

        TypeEnum(true,false,quick_deny_anonymous)
        Defaulttrue
        Description

        Set true (default) to enable client authentication on this listener, the authentication process goes through the configured authentication chain. When set to false, any client (with or without username/password) is allowed to connect. When set to quick_deny_anonymous, it behaves like when set to true, but clients will be denied immediately without going through any authenticators if username is not provided. This is useful to fence off anonymous clients early.

      • max_conn_rate

        TypeString
        Description

        Maximum connection rate.
        This is used to limit the connection rate for this node. Once the limit is reached, new connections will be deferred or refused.
        For example:

        • 1000/s :: Only accepts 1000 connections per second
        • 1000/10s :: Only accepts 1000 connections every 10 seconds.
      • messages_rate

        TypeString
        Description

        Messages publish rate.
        This is used to limit the inbound message numbers for this node. Once the limit is reached, the restricted client will slow down and even be hung for a while.
        For example:

        • 500/s :: Only the first 500 messages are sent per second and other messages are buffered.
        • 500/10s :: Only the first 500 messages are sent even 10 second and other messages are buffered.
      • bytes_rate

        TypeString
        Description

        Data publish rate.
        This is used to limit the inbound bytes rate for this node. Once the limit is reached, the restricted client will slow down and even be hung for a while.
        The unit of the bytes could be:KB MB GB.
        For example:

        • 500KB/s :: Only the first 500 kilobytes are sent per second and other messages are buffered.
        • 500MB/10s :: Only the first 500 megabytes are sent even 10 second and other messages are buffered.
      • access_rules

        TypeArray(String)
        Default["allow all"]
        Description

        The access control rules for this listener.
        See: https://github.com/emqtt/esockd#allowdeny

      • proxy_protocol

        TypeBoolean
        Defaultfalse
        Description

        Enable the Proxy Protocol V1/2 if the EMQX cluster is deployed behind HAProxy or Nginx.
        See: https://www.haproxy.com/blog/haproxy/proxy-protocol/

      • proxy_protocol_timeout

        TypeDuration
        Default"3s"
        Description

        Timeout for proxy protocol. EMQX will close the TCP connection if proxy protocol packet is not received within the timeout.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • tcp_options

        TypeStruct(tcp_opts)

        tcp_opts

        • active_n
          TypeInteger
          Default100
          Description

          Specify the {active, N} option for this Socket.
          See: https://erlang.org/doc/man/inet.html#setopts-2

        • backlog
          TypeInteger(1..+inf)
          Default1024
          Description

          TCP backlog defines the maximum length that the queue of pending connections can grow to.

        • send_timeout
          TypeDuration
          Default"15s"
          Description

          The TCP send timeout for the connections.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • send_timeout_close
          TypeBoolean
          Defaulttrue
          Description

          Close the connection if send timeout.

        • recbuf
          TypeBytesize
          Description

          The TCP receive buffer (OS kernel) for the connections.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • sndbuf
          TypeBytesize
          Description

          The TCP send buffer (OS kernel) for the connections.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • buffer
          TypeBytesize
          Default"4KB"
          Description

          The size of the user-space buffer used by the driver.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • high_watermark
          TypeBytesize
          Default"1MB"
          Description

          The socket is set to a busy state when the amount of data queued internally by the VM socket implementation reaches this limit.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • nodelay
          TypeBoolean
          Defaulttrue
          Description

          The TCP_NODELAY flag for the connections.

        • reuseaddr
          TypeBoolean
          Defaulttrue
          Description

          The SO_REUSEADDR flag for the connections.

        • keepalive
          TypeString
          Defaultnone
          Description

          Enable TCP keepalive for MQTT connections over TCP or SSL. The value is three comma separated numbers in the format of 'Idle,Interval,Probes'

          • Idle: The number of seconds a connection needs to be idle before the server begins to send out keep-alive probes (Linux default 7200).
          • Interval: The number of seconds between TCP keep-alive probes (Linux default 75).
          • Probes: The maximum number of TCP keep-alive probes to send before giving up and killing the connection if no response is obtained from the other end (Linux default 9). For example "240,30,5" means: EMQX should start sending TCP keepalive probes after the connection is in idle for 240 seconds, and the probes are sent every 30 seconds until a response is received from the MQTT client, if it misses 5 consecutive responses, EMQX should close the connection. Default: 'none'
      • ssl_options

        TypeStruct(listener_wss_opts)

        listener_wss_opts

        • cacertfile
          TypeString
          Default"${EMQX_ETC_DIR}/certs/cacert.pem"
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Default"${EMQX_ETC_DIR}/certs/cert.pem"
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Default"${EMQX_ETC_DIR}/certs/key.pem"
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • dhfile
          TypeString
          Description

          Path to a file containing PEM-encoded Diffie-Hellman parameters to be used by the server if a cipher suite using Diffie-Hellman key exchange is negotiated. If not specified, default parameters are used.
          NOTE: The dhfile option is not supported by TLS 1.3.

        • fail_if_no_peer_cert
          TypeBoolean
          Defaultfalse
          Description

          Used together with {verify, verify_peer} by an TLS/DTLS server. If set to true, the server fails if the client does not have a certificate to send, that is, sends an empty certificate. If set to false, it fails only if the client sends an invalid certificate (an empty certificate is considered valid).

        • honor_cipher_order
          TypeBoolean
          Defaulttrue
          Description

          An important security setting. It forces the cipher to be set based on the server-specified order instead of the client-specified order, hence enforcing the (usually more properly configured) security ordering of the server administrator.

        • client_renegotiation
          TypeBoolean
          Defaulttrue
          Description

          In protocols that support client-initiated renegotiation, the cost of resources of such an operation is higher for the server than the client. This can act as a vector for denial of service attacks. The SSL application already takes measures to counter-act such attempts, but client-initiated renegotiation can be strictly disabled by setting this option to false. The default value is true. Note that disabling renegotiation can result in long-lived connections becoming unusable due to limits on the number of messages the underlying cipher suite can encipher.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • handshake_timeout
          TypeDuration
          Default"15s"
          Description

          Maximum time duration allowed for the handshake to complete
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • websocket

        TypeStruct(ws_opts)

        ws_opts

        • mqtt_path
          TypeString
          Default"/mqtt"
          Description

          WebSocket's MQTT protocol path. By default, the full URL for the WebSocket client to connect is: ws://{ip}:{port}/mqtt. Append /[...] to the end of the path to make EMQX accept any subpath. For example, specifying mqtt/[...] would allow clients to connect at paths like mqtt/org1 or mqtt/group2, etc.

          NOTE: An unmatched path will cause the client to be rejected immediately at the HTTP layer, meaning it will not be traceable at the MQTT layer.

        • mqtt_piggyback
          TypeEnum(single,multiple)
          Defaultmultiple
          Description

          Whether a WebSocket message is allowed to contain multiple MQTT packets.

        • compress
          TypeBoolean
          Defaultfalse
          Description

          If true, compress WebSocket messages using zlib.
          The configuration items under deflate_opts belong to the compression-related parameter configuration.

        • idle_timeout
          TypeDuration
          Default"7200s"
          Description

          Close transport-layer connections from the clients that have not sent MQTT CONNECT message within this interval.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • max_frame_size
          TypeOneOf(String("infinity"),Integer)
          Defaultinfinity
          Description

          The maximum length of a single MQTT packet.

        • fail_if_no_subprotocol
          TypeBoolean
          Defaulttrue
          Description

          If true, the server will return an error when the client does not carry the Sec-WebSocket-Protocol field.
          Note: WeChat applet needs to disable this verification.

        • supported_subprotocols
          TypeString
          Default"mqtt, mqtt-v3, mqtt-v3.1.1, mqtt-v5"
          Description

          Comma-separated list of supported subprotocols.

        • check_origin_enable
          TypeBoolean
          Defaultfalse
          Description

          If true, origin HTTP header will be validated against the list of allowed origins configured in check_origins parameter.

        • allow_origin_absence
          TypeBoolean
          Defaulttrue
          Description

          If false and check_origin_enable is true, the server will reject requests that don't have origin HTTP header.

        • check_origins
          TypeString
          Default"http://localhost:18083, http://127.0.0.1:18083"
          Description

          List of allowed origins.
          See check_origin_enable.

        • proxy_address_header
          TypeString
          Default"x-forwarded-for"
          Description

          HTTP header used to pass information about the client IP address. Relevant when the EMQX cluster is deployed behind a load-balancer.

        • proxy_port_header
          TypeString
          Default"x-forwarded-port"
          Description

          HTTP header used to pass information about the client port. Relevant when the EMQX cluster is deployed behind a load-balancer.

        • deflate_opts
          TypeStruct(deflate_opts)

          deflate_opts

          • level
            TypeEnum(none,default,best_compression,best_speed)
            Description

            Compression level.

          • mem_level
            TypeInteger(1..9)
            Default8
            Description

            Specifies the size of the compression state.
            Lower values decrease memory usage per connection.

          • strategy
            TypeEnum(default,filtered,huffman_only,rle)
            Defaultdefault
            Description

            Specifies the compression strategy.

          • server_context_takeover
            TypeEnum(takeover,no_takeover)
            Defaulttakeover
            Description

            Takeover means the compression state is retained between server messages.

          • client_context_takeover
            TypeEnum(takeover,no_takeover)
            Defaulttakeover
            Description

            Takeover means the compression state is retained between client messages.

          • server_max_window_bits
            TypeInteger(8..15)
            Default15
            Description

            Specifies the size of the compression context for the server.

          • client_max_window_bits
            TypeInteger(8..15)
            Default15
            Description

            Specifies the size of the compression context for the client.

        • validate_utf8
          TypeBoolean
          Defaulttrue
          Description

          Set to false to disable WebSocket Frame UTF-8 validation for performance

    • quic

      TypeMap($name->OneOf(Struct(mqtt_quic_listener),String("marked_for_deletion")))
      Description

      QUIC listeners.

      mqtt_quic_listener

      • ciphers

        TypeArray(String)
        Default[TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, TLS_CHACHA20_POLY1305_SHA256]
        Description

        This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
        Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

        The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

        NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
        If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
        PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        NOTE: QUIC listener supports only 'tlsv1.3' ciphers

      • ssl_options

        TypeStruct(listener_quic_ssl_opts)
        Description

        TLS options for QUIC transport

        listener_quic_ssl_opts

        • cacertfile
          TypeString
          Default"${EMQX_ETC_DIR}/certs/cacert.pem"
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • certfile
          TypeString
          Default"${EMQX_ETC_DIR}/certs/cert.pem"
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Default"${EMQX_ETC_DIR}/certs/key.pem"
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

      • enable

        Aliasesenabled
        TypeBoolean
        Defaulttrue
        Description

        Enable listener.

      • bind

        TypeString
        Default14567
        Description

        IP address and port for the listening socket.

      • acceptors

        TypeInteger(1..+inf)
        Default16
        Description

        The size of the listener's receiving pool.

      • max_connections

        TypeOneOf(String("infinity"),Integer(1..+inf))
        Defaultinfinity
        Description

        The maximum number of concurrent connections allowed by the listener.

      • mountpoint

        TypeString
        Default""
        Description

        When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t.
        Set to "" to disable the feature.

        Variables in mountpoint string:

        • ${clientid}: clientid
        • ${username}: username
      • zone

        TypeString
        Defaultdefault
        Description

        The configuration zone to which the listener belongs. Clients connected to this listener will inherit zone-settings created under this zone name.

        A zone can override the configs under below root names:

        • mqtt
        • force_shutdown
        • force_gc
        • flapping_detect
        • durable_sessions
      • enable_authn

        TypeEnum(true,false,quick_deny_anonymous)
        Defaulttrue
        Description

        Set true (default) to enable client authentication on this listener, the authentication process goes through the configured authentication chain. When set to false, any client (with or without username/password) is allowed to connect. When set to quick_deny_anonymous, it behaves like when set to true, but clients will be denied immediately without going through any authenticators if username is not provided. This is useful to fence off anonymous clients early.

      • max_conn_rate

        TypeString
        Description

        Maximum connection rate.
        This is used to limit the connection rate for this node. Once the limit is reached, new connections will be deferred or refused.
        For example:

        • 1000/s :: Only accepts 1000 connections per second
        • 1000/10s :: Only accepts 1000 connections every 10 seconds.
      • messages_rate

        TypeString
        Description

        Messages publish rate.
        This is used to limit the inbound message numbers for this node. Once the limit is reached, the restricted client will slow down and even be hung for a while.
        For example:

        • 500/s :: Only the first 500 messages are sent per second and other messages are buffered.
        • 500/10s :: Only the first 500 messages are sent even 10 second and other messages are buffered.
      • bytes_rate

        TypeString
        Description

        Data publish rate.
        This is used to limit the inbound bytes rate for this node. Once the limit is reached, the restricted client will slow down and even be hung for a while.
        The unit of the bytes could be:KB MB GB.
        For example:

        • 500KB/s :: Only the first 500 kilobytes are sent per second and other messages are buffered.
        • 500MB/10s :: Only the first 500 megabytes are sent even 10 second and other messages are buffered.
  • mqtt

    TypeStruct(mqtt)
    Description

    Global MQTT configuration. The configs here work as default values which can be overridden in zone configs

    mqtt

    • idle_timeout

      TypeOneOf(String("infinity"),Duration)
      Default"15s"
      Description

      Configure the duration of time that a connection can remain idle (i.e., without any data transfer) before being:

      • Automatically disconnected if no CONNECT package is received from the client yet.
      • Put into hibernation mode to save resources if some CONNECT packages are already received. Note: Please set the parameter with caution as long idle time will lead to resource waste.
    • max_packet_size

      TypeBytesize
      Default"1MB"
      Description

      Maximum MQTT packet size allowed. Default: 1 MB, Maximum: 256 MB
      A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

    • max_clientid_len

      TypeInteger(23..65535)
      Default65535
      Description

      Maximum allowed length of MQTT Client ID.

    • max_topic_levels

      TypeInteger(1..65535)
      Default128
      Description

      Maximum topic levels allowed.

    • max_topic_alias

      TypeInteger(0..65535)
      Default65535
      Description

      Maximum topic alias, 0 means no topic alias supported.

    • retain_available

      TypeBoolean
      Defaulttrue
      Description

      Whether to enable support for MQTT retained message.

    • wildcard_subscription

      TypeBoolean
      Defaulttrue
      Description

      Whether to enable support for MQTT wildcard subscription.

    • shared_subscription

      TypeBoolean
      Defaulttrue
      Description

      Whether to enable support for MQTT shared subscription.

    • shared_subscription_strategy

      TypeEnum(random,round_robin,round_robin_per_group,sticky,local,hash_topic,hash_clientid)
      Defaultround_robin
      Description

      Dispatch strategy for shared subscription.

      • random: Randomly select a subscriber for dispatch;
      • round_robin: Messages from a single publisher are dispatched to subscribers in turn;
      • round_robin_per_group: All messages are dispatched to subscribers in turn;
      • local: Randomly select a subscriber on the current node, if there are no subscribers on the current node, then randomly select within the cluster;
      • sticky: Continuously dispatch messages to the initially selected subscriber until their session ends;
      • hash_clientid: Hash the publisher's client ID to select a subscriber;
      • hash_topic: Hash the publishing topic to select a subscriber.
    • exclusive_subscription

      TypeBoolean
      Defaultfalse
      Description

      Whether to enable support for MQTT exclusive subscription.

    • ignore_loop_deliver

      TypeBoolean
      Defaultfalse
      Description

      Whether the messages sent by the MQTT v3.1.1/v3.1.0 client will be looped back to the publisher itself, similar to No Local in MQTT 5.0.

    • strict_mode

      TypeBoolean
      Defaultfalse
      Description

      Whether to parse MQTT messages in strict mode. In strict mode, invalid utf8 strings in for example client ID, topic name, etc. will cause the client to be disconnected.

    • response_information

      TypeString
      Default""
      Description

      UTF-8 string, for creating the response topic, for example, if set to reqrsp/, the publisher/subscriber will communicate using the topic prefix reqrsp/. To disable this feature, input "" in the text box below. Only applicable to MQTT 5.0 clients.

    • server_keepalive

      TypeOneOf(Integer(1..+inf),String("disabled"))
      Defaultdisabled
      Description

      The keep alive duration required by EMQX. To use the setting from the client side, choose disabled from the drop-down list. Only applicable to MQTT 5.0 clients.

    • keepalive_multiplier

      TypeNumber
      Default1.5
      Description

      Keep-Alive Timeout = Keep-Alive interval × Keep-Alive Multiplier. The default value 1.5 is following the MQTT 5.0 specification. This multiplier is adjustable, providing system administrators flexibility for tailoring to their specific needs. For instance, if a client's 10-second Keep-Alive interval PINGREQ gets delayed by an extra 10 seconds, changing the multiplier to 2 lets EMQX tolerate this delay.

    • retry_interval

      TypeDuration
      Default"30s"
      Description

      Retry interval for QoS 1/2 message delivering.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • use_username_as_clientid

      TypeBoolean
      Defaultfalse
      Description

      Whether to use Username as Client ID. This setting takes effect later than Use Peer Certificate as Username and Use peer certificate as Client ID.

    • peer_cert_as_username

      TypeEnum(disabled,cn,dn,crt,pem,md5)
      Defaultdisabled
      Description

      Use the CN, DN field in the peer certificate or the entire certificate content as Username. Only works for the TLS connection. Supported configurations are the following:

      • cn: CN field of the certificate
      • dn: DN field of the certificate
      • crt: Content of the DER or PEM certificate
      • pem: Convert DER certificate content to PEM format and use as Username
      • md5: MD5 value of the DER or PEM certificate
    • peer_cert_as_clientid

      TypeEnum(disabled,cn,dn,crt,pem,md5)
      Defaultdisabled
      Description

      Use the CN, DN field in the peer certificate or the entire certificate content as Client ID. Only works for the TLS connection. Supported configurations are the following:

      • cn: CN field of the certificate
      • dn: DN field of the certificate
      • crt: DER or PEM certificate
      • pem: Convert DER certificate content to PEM format and use as Client ID
      • md5: MD5 value of the DER or PEM certificate
    • client_attrs_init

      TypeArray(Struct(client_attrs_init))
      Default[]
      Description

      Specify how to initialize client attributes. Each client attribute can be initialized as client_attrs.{NAME}, where {NAME} is the name of the attribute specified in the config field set_as_attr. The initialized client attribute will be stored in the client_attrs property with the specified name, and can be used as a placeholder in a template for authentication and authorization. For example, use ${client_attrs.alias} to render an HTTP POST body when set_as_attr = alias, or render listener config moutpoint = devices/${client_attrs.alias}/ to initialize a per-client topic namespace.

      client_attrs_init

      • expression

        TypeString
        Description

        A one line expression to evaluate a set of predefined string functions (like in the rule engine SQL statements). The expression can be a function call with nested calls as its arguments, or direct variable reference. So far, it does not provide user-defined variable binding (like var a=1) or user-defined functions. As an example, to extract the prefix of client ID delimited by a dot: nth(1, tokens(clientid, '.')).

        The variables pre-bound variables are:

        • cn: Client's TLS certificate common name.
        • dn: Client's TLS certificate distinguished name (the subject).
        • clientid: MQTT Client ID.
        • username: MQTT Client's username.
        • user_property.{NAME}: User properties in the CONNECT packet.

        You can read more about variform expressions in EMQX docs.

      • set_as_attr

        TypeString
        Description

        The name of the client attribute extracted from the client data. The extracted attribute will be stored in the client_attrs property with this name.

    • session_expiry_interval

      TypeDuration
      Default"2h"
      Description

      Specifies how long the session will expire after the connection is disconnected, only for non-MQTT 5.0 connections.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • message_expiry_interval

      TypeOneOf(Duration,String("infinity"))
      Defaultinfinity
      Description

      The expiry interval of MQTT messages. For MQTT 5.0 clients, this configuration will only take effect when the Message-Expiry-Interval property is not set in the message; otherwise, the value of the Message-Expiry-Interval property will be used. For MQTT versions older than 5.0, this configuration will always take effect. Please note that setting message_expiry_interval greater than session_expiry_interval is meaningless, as all messages will be cleared when the session expires.

    • max_awaiting_rel

      TypeOneOf(Integer(0..+inf),String("infinity"))
      Default100
      Description

      For each publisher session, the maximum number of outstanding QoS 2 messages pending on the client to send PUBREL. After reaching this limit, new QoS 2 PUBLISH requests will be rejected with 147(0x93) until either PUBREL is received or timed out.

    • max_qos_allowed

      TypeInteger(0..2)
      Default2
      Description

      Maximum QoS allowed.

    • mqueue_priorities

      TypeOneOf(String("disabled"),Map)
      Defaultdisabled
      Description

      Topic priorities. Priority number [1-255] There's no priority table by default, hence all messages are treated equal.

      NOTE: Comma and equal signs are not allowed for priority topic names. NOTE: Messages for topics not in the priority table are treated as either highest or lowest priority depending on the configured value for mqtt.mqueue_default_priority.

      Examples: To configure "topic/1" > "topic/2": mqueue_priorities: {"topic/1": 10, "topic/2": 8}

    • mqueue_default_priority

      TypeEnum(highest,lowest)
      Defaultlowest
      Description

      Default topic priority, which will be used by topics not in Topic Priorities (mqueue_priorities).

    • mqueue_store_qos0

      TypeBoolean
      Defaulttrue
      Description

      Specifies whether to store QoS 0 messages in the message queue while the connection is down but the session remains.

    • max_mqueue_len

      TypeOneOf(Integer(0..+inf),String("infinity"))
      Default1000
      Description

      Maximum queue length. Enqueued messages when persistent client disconnected, or inflight window is full.

    • max_inflight

      TypeInteger(1..65535)
      Default32
      Description

      Maximum number of QoS 1 and QoS 2 messages that are allowed to be delivered simultaneously before completing the acknowledgment.

    • max_subscriptions

      TypeOneOf(Integer(1..inf),String("infinity"))
      Defaultinfinity
      Description

      Maximum number of subscriptions allowed per client.

    • upgrade_qos

      TypeBoolean
      Defaultfalse
      Description

      Force upgrade of QoS level according to subscription.

    • await_rel_timeout

      TypeDuration
      Default"300s"
      Description

      For client to broker QoS 2 message, the time limit for the broker to wait before the PUBREL message is received. The wait is aborted after timed out, meaning the packet ID is freed for new PUBLISH requests. Receiving a stale PUBREL causes a warning level log. Note, the message is delivered to subscribers before entering the wait for PUBREL.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

  • authentication

    TypeArray(OneOf(Struct(builtin_db),Struct(mysql),Struct(postgresql),Struct(mongo_single),Struct(mongo_rs),Struct(mongo_sharded),Struct(redis_single),Struct(redis_cluster),Struct(redis_sentinel),Struct(http_get),Struct(http_post),Struct(jwt_hmac),Struct(jwt_public_key),Struct(jwt_jwks),Struct(scram),Struct(ldap),Struct(ldap_deprecated)))
    Default[]
    Description

    Default authentication configs for all MQTT listeners.

    For per-listener overrides see authentication in listener configs

    This option can be configured with:

    • []: The default value, it allows *ALL* logins
    • one: For example {enable:true,backend:"built_in_database",mechanism="password_based"}
    • chain: An array of structs.

    When a chain is configured, the login credentials are checked against the backends per the configured order, until an 'allow' or 'deny' decision can be made.

    If there is no decision after a full chain exhaustion, the login is rejected.

    builtin_db

    • password_hash_algorithm

      TypeOneOf(Struct(bcrypt_rw),Struct(pbkdf2),Struct(simple))
      Default{name = sha256, salt_position = prefix}
      Description

      Options for password hash creation and verification.

      bcrypt_rw

      • name

        TypeString("bcrypt")
        Description

        BCRYPT password hashing.

      • salt_rounds

        TypeInteger(5..10)
        Default10
        Description

        Work factor for BCRYPT password generation.

      pbkdf2

      • name

        TypeString("pbkdf2")
        Description

        PBKDF2 password hashing.

      • mac_fun

        TypeEnum(md4,md5,ripemd160,sha,sha224,sha256,sha384,sha512)
        Description

        Specifies mac_fun for PBKDF2 hashing algorithm.

      • iterations

        TypeInteger(1..+inf)
        Description

        Iteration count for PBKDF2 hashing algorithm.

      • dk_length

        TypeInteger
        Description

        Derived length for PBKDF2 hashing algorithm. If not specified, calculated automatically based on mac_fun.

      simple

      • name

        TypeEnum(plain,md5,sha,sha256,sha512)
        Description

        Simple password hashing algorithm.

      • salt_position

        TypeEnum(disable,prefix,suffix)
        Defaultprefix
        Description

        Salt position for PLAIN, MD5, SHA, SHA256 and SHA512 algorithms.

    • mechanism

      TypeString("password_based")
      Description

      Authentication mechanism.

    • backend

      TypeString("built_in_database")
      Description

      Backend type.

    • user_id_type

      TypeEnum(clientid,username)
      Defaultusername
      Description

      Specify whether to use clientid or username for authentication.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    mysql

    • mechanism

      TypeString("password_based")
      Description

      Authentication mechanism.

    • backend

      TypeString("mysql")
      Description

      Backend type.

    • password_hash_algorithm

      TypeOneOf(Struct(bcrypt),Struct(pbkdf2),Struct(simple))
      Default{name = sha256, salt_position = prefix}
      Description

      Options for password hash verification.

      bcrypt

      • name

        TypeString("bcrypt")
        Description

        BCRYPT password hashing.

      pbkdf2

      • name

        TypeString("pbkdf2")
        Description

        PBKDF2 password hashing.

      • mac_fun

        TypeEnum(md4,md5,ripemd160,sha,sha224,sha256,sha384,sha512)
        Description

        Specifies mac_fun for PBKDF2 hashing algorithm.

      • iterations

        TypeInteger(1..+inf)
        Description

        Iteration count for PBKDF2 hashing algorithm.

      • dk_length

        TypeInteger
        Description

        Derived length for PBKDF2 hashing algorithm. If not specified, calculated automatically based on mac_fun.

      simple

      • name

        TypeEnum(plain,md5,sha,sha256,sha512)
        Description

        Simple password hashing algorithm.

      • salt_position

        TypeEnum(disable,prefix,suffix)
        Defaultprefix
        Description

        Salt position for PLAIN, MD5, SHA, SHA256 and SHA512 algorithms.

    • query

      TypeString
      Description

      SQL used to query data for authentication, such as password hash.

    • query_timeout

      TypeDuration
      Default"5s"
      Description

      Timeout for the SQL query.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    • server

      TypeString
      Description

      The IPv4 or IPv6 address or the hostname to connect to.
      A host entry has the following form: Host[:Port].
      The MySQL default port 3306 is used if [:Port] is not specified.

    • database

      TypeString
      Description

      Database name.

    • pool_size

      TypeInteger(1..+inf)
      Default8
      Description

      Size of the connection pool towards the bridge target service.

    • username

      TypeString
      Defaultroot
      Description

      The username associated with the bridge in the external database used for authentication or identification purposes.

    • password

      TypeSecret
      Description

      The password associated with the bridge, used for authentication with the external database.
      A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

    • auto_reconnect

      TypeBoolean
      Description

      Deprecated since v5.0.15.

    • ssl

      TypeStruct(ssl_client_opts)
      Default{enable = false}
      Description

      SSL connection settings.

      ssl_client_opts

      • cacertfile

        TypeString
        Description

        Trusted PEM format CA certificates bundle file.
        The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
        NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

      • cacerts

        TypeBoolean
        Description

        Deprecated since 5.1.4.

      • certfile

        TypeString
        Description

        PEM format certificates chain file.
        The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

      • keyfile

        TypeString
        Description

        PEM format private key file.

      • verify

        TypeEnum(verify_peer,verify_none)
        Defaultverify_none
        Description

        Enable or disable peer verification.

      • reuse_sessions

        TypeBoolean
        Defaulttrue
        Description

        Enable TLS session reuse.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • depth

        TypeInteger(0..+inf)
        Default10
        Description

        Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
        if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
        if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

      • password

        TypeString
        Description

        String containing the user's password. Only used if the private key file is password-protected.

      • versions

        TypeArray(String)
        Default["tlsv1.3", "tlsv1.2"]
        Description

        All TLS/DTLS versions to be supported.
        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
        In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

      • ciphers

        TypeArray(String)
        Default[]
        Description

        This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
        Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

        The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

        NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
        If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
        PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

      • secure_renegotiate

        TypeBoolean
        Defaulttrue
        Description

        SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • log_level

        TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
        Defaultnotice
        Description

        Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

      • hibernate_after

        TypeDuration
        Default"5s"
        Description

        Hibernate the SSL process after idling for amount of time reducing its memory footprint.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable TLS.

      • server_name_indication

        TypeOneOf(String("disable"),String)
        Description

        Specify the host name to be used in TLS Server Name Indication extension.
        For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
        If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
        The host name is then also used in the host name verification of the peer certificate.
        The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    postgresql

    • mechanism

      TypeString("password_based")
      Description

      Authentication mechanism.

    • backend

      TypeString("postgresql")
      Description

      Backend type.

    • password_hash_algorithm

      TypeOneOf(Struct(bcrypt),Struct(pbkdf2),Struct(simple))
      Default{name = sha256, salt_position = prefix}
      Description

      Options for password hash verification.

      bcrypt

      • name

        TypeString("bcrypt")
        Description

        BCRYPT password hashing.

      pbkdf2

      • name

        TypeString("pbkdf2")
        Description

        PBKDF2 password hashing.

      • mac_fun

        TypeEnum(md4,md5,ripemd160,sha,sha224,sha256,sha384,sha512)
        Description

        Specifies mac_fun for PBKDF2 hashing algorithm.

      • iterations

        TypeInteger(1..+inf)
        Description

        Iteration count for PBKDF2 hashing algorithm.

      • dk_length

        TypeInteger
        Description

        Derived length for PBKDF2 hashing algorithm. If not specified, calculated automatically based on mac_fun.

      simple

      • name

        TypeEnum(plain,md5,sha,sha256,sha512)
        Description

        Simple password hashing algorithm.

      • salt_position

        TypeEnum(disable,prefix,suffix)
        Defaultprefix
        Description

        Salt position for PLAIN, MD5, SHA, SHA256 and SHA512 algorithms.

    • query

      TypeString
      Description

      SQL used to query data for authentication, such as password hash.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    • server

      TypeString
      Description

      The IPv4 or IPv6 address or the hostname to connect to.
      A host entry has the following form: Host[:Port].
      The PostgreSQL default port 5432 is used if [:Port] is not specified.

    • disable_prepared_statements

      TypeBoolean
      Defaultfalse
      Description

      Disables the usage of prepared statements in the connections. Some endpoints, like PGBouncer or Supabase in Transaction mode, do not support session features such as prepared statements. For such connections, this option should be enabled.

    • database

      TypeString
      Description

      Database name.

    • pool_size

      TypeInteger(1..+inf)
      Default8
      Description

      Size of the connection pool towards the bridge target service.

    • username

      TypeString
      Description

      The username associated with the bridge in the external database used for authentication or identification purposes.

    • password

      TypeSecret
      Description

      The password associated with the bridge, used for authentication with the external database.
      A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

    • auto_reconnect

      TypeBoolean
      Description

      Deprecated since v5.0.15.

    • ssl

      TypeStruct(ssl_client_opts)
      Default{enable = false}
      Description

      SSL connection settings.

      ssl_client_opts

      • cacertfile

        TypeString
        Description

        Trusted PEM format CA certificates bundle file.
        The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
        NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

      • cacerts

        TypeBoolean
        Description

        Deprecated since 5.1.4.

      • certfile

        TypeString
        Description

        PEM format certificates chain file.
        The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

      • keyfile

        TypeString
        Description

        PEM format private key file.

      • verify

        TypeEnum(verify_peer,verify_none)
        Defaultverify_none
        Description

        Enable or disable peer verification.

      • reuse_sessions

        TypeBoolean
        Defaulttrue
        Description

        Enable TLS session reuse.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • depth

        TypeInteger(0..+inf)
        Default10
        Description

        Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
        if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
        if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

      • password

        TypeString
        Description

        String containing the user's password. Only used if the private key file is password-protected.

      • versions

        TypeArray(String)
        Default["tlsv1.3", "tlsv1.2"]
        Description

        All TLS/DTLS versions to be supported.
        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
        In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

      • ciphers

        TypeArray(String)
        Default[]
        Description

        This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
        Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

        The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

        NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
        If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
        PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

      • secure_renegotiate

        TypeBoolean
        Defaulttrue
        Description

        SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • log_level

        TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
        Defaultnotice
        Description

        Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

      • hibernate_after

        TypeDuration
        Default"5s"
        Description

        Hibernate the SSL process after idling for amount of time reducing its memory footprint.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable TLS.

      • server_name_indication

        TypeOneOf(String("disable"),String)
        Description

        Specify the host name to be used in TLS Server Name Indication extension.
        For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
        If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
        The host name is then also used in the host name verification of the peer certificate.
        The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    mongo_single

    • mechanism

      TypeString("password_based")
      Description

      Authentication mechanism.

    • backend

      TypeString("mongodb")
      Description

      Backend type.

    • collection

      TypeString
      Description

      Collection used to store authentication data.

    • filter

      TypeMap
      Default{}
      Description

      Conditional expression that defines the filter condition in the query. Filter supports the following placeholders:

      • ${username}: Will be replaced at runtime with Username used by the client when connecting
      • ${clientid}: Will be replaced at runtime with Client ID used by the client when connecting
    • password_hash_field

      TypeString
      Defaultpassword_hash
      Description

      Document field that contains password hash.

    • salt_field

      TypeString
      Defaultsalt
      Description

      Document field that contains the password salt.

    • is_superuser_field

      TypeString
      Defaultis_superuser
      Description

      Document field that defines if the user has superuser privileges.

    • password_hash_algorithm

      TypeOneOf(Struct(bcrypt),Struct(pbkdf2),Struct(simple))
      Default{name = sha256, salt_position = prefix}
      Description

      Options for password hash verification.

      bcrypt

      • name

        TypeString("bcrypt")
        Description

        BCRYPT password hashing.

      pbkdf2

      • name

        TypeString("pbkdf2")
        Description

        PBKDF2 password hashing.

      • mac_fun

        TypeEnum(md4,md5,ripemd160,sha,sha224,sha256,sha384,sha512)
        Description

        Specifies mac_fun for PBKDF2 hashing algorithm.

      • iterations

        TypeInteger(1..+inf)
        Description

        Iteration count for PBKDF2 hashing algorithm.

      • dk_length

        TypeInteger
        Description

        Derived length for PBKDF2 hashing algorithm. If not specified, calculated automatically based on mac_fun.

      simple

      • name

        TypeEnum(plain,md5,sha,sha256,sha512)
        Description

        Simple password hashing algorithm.

      • salt_position

        TypeEnum(disable,prefix,suffix)
        Defaultprefix
        Description

        Salt position for PLAIN, MD5, SHA, SHA256 and SHA512 algorithms.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    • mongo_type

      TypeString("single")
      Defaultsingle
      Description

      Standalone instance. Must be set to 'single' when MongoDB server is running in standalone mode.

    • server

      TypeString
      Description

      The IPv4 or IPv6 address or the hostname to connect to.
      A host entry has the following form: Host[:Port].
      The MongoDB default port 27017 is used if [:Port] is not specified.

    • w_mode

      TypeEnum(unsafe,safe)
      Defaultunsafe
      Description

      Write mode.

    • srv_record

      TypeBoolean
      Defaultfalse
      Description

      Use DNS SRV record.

    • pool_size

      TypeInteger(1..+inf)
      Default8
      Description

      Size of the connection pool towards the bridge target service.

    • username

      TypeString
      Description

      The username associated with the bridge in the external database used for authentication or identification purposes.

    • password

      TypeSecret
      Description

      The password associated with the bridge, used for authentication with the external database.
      A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

    • use_legacy_protocol

      TypeEnum(auto,true,false)
      Defaultauto
      Description

      Whether to use MongoDB's legacy protocol for communicating with the database. The default is to attempt to automatically determine if the newer protocol is supported.

    • auth_source

      TypeString
      Description

      Database name associated with the user's credentials.

    • database

      TypeString
      Description

      Database name.

    • topology

      TypeStruct(topology)

      topology

      • max_overflow

        TypeInteger(0..+inf)
        Default0
        Description

        The maximum number of additional workers that can be created when all workers in the pool are busy. This helps to manage temporary spikes in workload by allowing more concurrent connections to the MongoDB server.

      • overflow_ttl

        TypeDuration
        Description

        Period of time before workers that exceed the configured pool size ("overflow") to be terminated.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • overflow_check_period

        TypeDuration
        Description

        Period for checking if there are more workers than configured ("overflow").
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • local_threshold_ms

        TypeDuration
        Description

        The size of the latency window for selecting among multiple suitable MongoDB instances.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • connect_timeout_ms

        TypeDuration
        Description

        The duration to attempt a connection before timing out.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • socket_timeout_ms

        TypeDuration
        Description

        The duration to attempt to send or to receive on a socket before the attempt times out.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • server_selection_timeout_ms

        TypeDuration
        Description

        Specifies how long to block for server selection before throwing an exception.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • wait_queue_timeout_ms

        TypeDuration
        Description

        The maximum duration that a worker can wait for a connection to become available.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • heartbeat_frequency_ms

        TypeDuration
        Default"200s"
        Description

        Controls when the driver checks the state of the MongoDB deployment. Specify the interval between checks, counted from the end of the previous check until the beginning of the next one. If the number of connections is increased (which will happen, for example, if you increase the pool size), you may need to increase this period as well to avoid creating too many log entries in the MongoDB log file.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • min_heartbeat_frequency_ms

        TypeDuration
        Description

        Controls the minimum amount of time to wait between heartbeats.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • ssl

      TypeStruct(ssl_client_opts)
      Default{enable = false}
      Description

      SSL connection settings.

      ssl_client_opts

      • cacertfile

        TypeString
        Description

        Trusted PEM format CA certificates bundle file.
        The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
        NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

      • cacerts

        TypeBoolean
        Description

        Deprecated since 5.1.4.

      • certfile

        TypeString
        Description

        PEM format certificates chain file.
        The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

      • keyfile

        TypeString
        Description

        PEM format private key file.

      • verify

        TypeEnum(verify_peer,verify_none)
        Defaultverify_none
        Description

        Enable or disable peer verification.

      • reuse_sessions

        TypeBoolean
        Defaulttrue
        Description

        Enable TLS session reuse.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • depth

        TypeInteger(0..+inf)
        Default10
        Description

        Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
        if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
        if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

      • password

        TypeString
        Description

        String containing the user's password. Only used if the private key file is password-protected.

      • versions

        TypeArray(String)
        Default["tlsv1.3", "tlsv1.2"]
        Description

        All TLS/DTLS versions to be supported.
        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
        In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

      • ciphers

        TypeArray(String)
        Default[]
        Description

        This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
        Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

        The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

        NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
        If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
        PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

      • secure_renegotiate

        TypeBoolean
        Defaulttrue
        Description

        SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • log_level

        TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
        Defaultnotice
        Description

        Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

      • hibernate_after

        TypeDuration
        Default"5s"
        Description

        Hibernate the SSL process after idling for amount of time reducing its memory footprint.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable TLS.

      • server_name_indication

        TypeOneOf(String("disable"),String)
        Description

        Specify the host name to be used in TLS Server Name Indication extension.
        For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
        If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
        The host name is then also used in the host name verification of the peer certificate.
        The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    mongo_rs

    • mechanism

      TypeString("password_based")
      Description

      Authentication mechanism.

    • backend

      TypeString("mongodb")
      Description

      Backend type.

    • collection

      TypeString
      Description

      Collection used to store authentication data.

    • filter

      TypeMap
      Default{}
      Description

      Conditional expression that defines the filter condition in the query. Filter supports the following placeholders:

      • ${username}: Will be replaced at runtime with Username used by the client when connecting
      • ${clientid}: Will be replaced at runtime with Client ID used by the client when connecting
    • password_hash_field

      TypeString
      Defaultpassword_hash
      Description

      Document field that contains password hash.

    • salt_field

      TypeString
      Defaultsalt
      Description

      Document field that contains the password salt.

    • is_superuser_field

      TypeString
      Defaultis_superuser
      Description

      Document field that defines if the user has superuser privileges.

    • password_hash_algorithm

      TypeOneOf(Struct(bcrypt),Struct(pbkdf2),Struct(simple))
      Default{name = sha256, salt_position = prefix}
      Description

      Options for password hash verification.

      bcrypt

      • name

        TypeString("bcrypt")
        Description

        BCRYPT password hashing.

      pbkdf2

      • name

        TypeString("pbkdf2")
        Description

        PBKDF2 password hashing.

      • mac_fun

        TypeEnum(md4,md5,ripemd160,sha,sha224,sha256,sha384,sha512)
        Description

        Specifies mac_fun for PBKDF2 hashing algorithm.

      • iterations

        TypeInteger(1..+inf)
        Description

        Iteration count for PBKDF2 hashing algorithm.

      • dk_length

        TypeInteger
        Description

        Derived length for PBKDF2 hashing algorithm. If not specified, calculated automatically based on mac_fun.

      simple

      • name

        TypeEnum(plain,md5,sha,sha256,sha512)
        Description

        Simple password hashing algorithm.

      • salt_position

        TypeEnum(disable,prefix,suffix)
        Defaultprefix
        Description

        Salt position for PLAIN, MD5, SHA, SHA256 and SHA512 algorithms.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    • mongo_type

      TypeString("rs")
      Defaultrs
      Description

      Replica set. Must be set to 'rs' when MongoDB server is running in 'replica set' mode.

    • servers

      TypeString
      Description

      A Node list for Cluster to connect to. The nodes should be separated with commas, such as: Node[,Node]. For each Node should be: The IPv4 or IPv6 address or the hostname to connect to. A host entry has the following form: Host[:Port]. The MongoDB default port 27017 is used if [:Port] is not specified.

    • w_mode

      TypeEnum(unsafe,safe)
      Defaultunsafe
      Description

      Write mode.

    • r_mode

      TypeEnum(master,slave_ok)
      Defaultmaster
      Description

      Read mode.

    • replica_set_name

      TypeString
      Description

      Name of the replica set.

    • srv_record

      TypeBoolean
      Defaultfalse
      Description

      Use DNS SRV record.

    • pool_size

      TypeInteger(1..+inf)
      Default8
      Description

      Size of the connection pool towards the bridge target service.

    • username

      TypeString
      Description

      The username associated with the bridge in the external database used for authentication or identification purposes.

    • password

      TypeSecret
      Description

      The password associated with the bridge, used for authentication with the external database.
      A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

    • use_legacy_protocol

      TypeEnum(auto,true,false)
      Defaultauto
      Description

      Whether to use MongoDB's legacy protocol for communicating with the database. The default is to attempt to automatically determine if the newer protocol is supported.

    • auth_source

      TypeString
      Description

      Database name associated with the user's credentials.

    • database

      TypeString
      Description

      Database name.

    • topology

      TypeStruct(topology)

      topology

      • max_overflow

        TypeInteger(0..+inf)
        Default0
        Description

        The maximum number of additional workers that can be created when all workers in the pool are busy. This helps to manage temporary spikes in workload by allowing more concurrent connections to the MongoDB server.

      • overflow_ttl

        TypeDuration
        Description

        Period of time before workers that exceed the configured pool size ("overflow") to be terminated.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • overflow_check_period

        TypeDuration
        Description

        Period for checking if there are more workers than configured ("overflow").
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • local_threshold_ms

        TypeDuration
        Description

        The size of the latency window for selecting among multiple suitable MongoDB instances.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • connect_timeout_ms

        TypeDuration
        Description

        The duration to attempt a connection before timing out.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • socket_timeout_ms

        TypeDuration
        Description

        The duration to attempt to send or to receive on a socket before the attempt times out.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • server_selection_timeout_ms

        TypeDuration
        Description

        Specifies how long to block for server selection before throwing an exception.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • wait_queue_timeout_ms

        TypeDuration
        Description

        The maximum duration that a worker can wait for a connection to become available.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • heartbeat_frequency_ms

        TypeDuration
        Default"200s"
        Description

        Controls when the driver checks the state of the MongoDB deployment. Specify the interval between checks, counted from the end of the previous check until the beginning of the next one. If the number of connections is increased (which will happen, for example, if you increase the pool size), you may need to increase this period as well to avoid creating too many log entries in the MongoDB log file.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • min_heartbeat_frequency_ms

        TypeDuration
        Description

        Controls the minimum amount of time to wait between heartbeats.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • ssl

      TypeStruct(ssl_client_opts)
      Default{enable = false}
      Description

      SSL connection settings.

      ssl_client_opts

      • cacertfile

        TypeString
        Description

        Trusted PEM format CA certificates bundle file.
        The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
        NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

      • cacerts

        TypeBoolean
        Description

        Deprecated since 5.1.4.

      • certfile

        TypeString
        Description

        PEM format certificates chain file.
        The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

      • keyfile

        TypeString
        Description

        PEM format private key file.

      • verify

        TypeEnum(verify_peer,verify_none)
        Defaultverify_none
        Description

        Enable or disable peer verification.

      • reuse_sessions

        TypeBoolean
        Defaulttrue
        Description

        Enable TLS session reuse.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • depth

        TypeInteger(0..+inf)
        Default10
        Description

        Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
        if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
        if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

      • password

        TypeString
        Description

        String containing the user's password. Only used if the private key file is password-protected.

      • versions

        TypeArray(String)
        Default["tlsv1.3", "tlsv1.2"]
        Description

        All TLS/DTLS versions to be supported.
        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
        In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

      • ciphers

        TypeArray(String)
        Default[]
        Description

        This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
        Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

        The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

        NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
        If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
        PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

      • secure_renegotiate

        TypeBoolean
        Defaulttrue
        Description

        SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • log_level

        TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
        Defaultnotice
        Description

        Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

      • hibernate_after

        TypeDuration
        Default"5s"
        Description

        Hibernate the SSL process after idling for amount of time reducing its memory footprint.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable TLS.

      • server_name_indication

        TypeOneOf(String("disable"),String)
        Description

        Specify the host name to be used in TLS Server Name Indication extension.
        For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
        If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
        The host name is then also used in the host name verification of the peer certificate.
        The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    mongo_sharded

    • mechanism

      TypeString("password_based")
      Description

      Authentication mechanism.

    • backend

      TypeString("mongodb")
      Description

      Backend type.

    • collection

      TypeString
      Description

      Collection used to store authentication data.

    • filter

      TypeMap
      Default{}
      Description

      Conditional expression that defines the filter condition in the query. Filter supports the following placeholders:

      • ${username}: Will be replaced at runtime with Username used by the client when connecting
      • ${clientid}: Will be replaced at runtime with Client ID used by the client when connecting
    • password_hash_field

      TypeString
      Defaultpassword_hash
      Description

      Document field that contains password hash.

    • salt_field

      TypeString
      Defaultsalt
      Description

      Document field that contains the password salt.

    • is_superuser_field

      TypeString
      Defaultis_superuser
      Description

      Document field that defines if the user has superuser privileges.

    • password_hash_algorithm

      TypeOneOf(Struct(bcrypt),Struct(pbkdf2),Struct(simple))
      Default{name = sha256, salt_position = prefix}
      Description

      Options for password hash verification.

      bcrypt

      • name

        TypeString("bcrypt")
        Description

        BCRYPT password hashing.

      pbkdf2

      • name

        TypeString("pbkdf2")
        Description

        PBKDF2 password hashing.

      • mac_fun

        TypeEnum(md4,md5,ripemd160,sha,sha224,sha256,sha384,sha512)
        Description

        Specifies mac_fun for PBKDF2 hashing algorithm.

      • iterations

        TypeInteger(1..+inf)
        Description

        Iteration count for PBKDF2 hashing algorithm.

      • dk_length

        TypeInteger
        Description

        Derived length for PBKDF2 hashing algorithm. If not specified, calculated automatically based on mac_fun.

      simple

      • name

        TypeEnum(plain,md5,sha,sha256,sha512)
        Description

        Simple password hashing algorithm.

      • salt_position

        TypeEnum(disable,prefix,suffix)
        Defaultprefix
        Description

        Salt position for PLAIN, MD5, SHA, SHA256 and SHA512 algorithms.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    • mongo_type

      TypeString("sharded")
      Defaultsharded
      Description

      Sharded cluster. Must be set to 'sharded' when MongoDB server is running in 'sharded' mode.

    • servers

      TypeString
      Description

      A Node list for Cluster to connect to. The nodes should be separated with commas, such as: Node[,Node]. For each Node should be: The IPv4 or IPv6 address or the hostname to connect to. A host entry has the following form: Host[:Port]. The MongoDB default port 27017 is used if [:Port] is not specified.

    • w_mode

      TypeEnum(unsafe,safe)
      Defaultunsafe
      Description

      Write mode.

    • srv_record

      TypeBoolean
      Defaultfalse
      Description

      Use DNS SRV record.

    • pool_size

      TypeInteger(1..+inf)
      Default8
      Description

      Size of the connection pool towards the bridge target service.

    • username

      TypeString
      Description

      The username associated with the bridge in the external database used for authentication or identification purposes.

    • password

      TypeSecret
      Description

      The password associated with the bridge, used for authentication with the external database.
      A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

    • use_legacy_protocol

      TypeEnum(auto,true,false)
      Defaultauto
      Description

      Whether to use MongoDB's legacy protocol for communicating with the database. The default is to attempt to automatically determine if the newer protocol is supported.

    • auth_source

      TypeString
      Description

      Database name associated with the user's credentials.

    • database

      TypeString
      Description

      Database name.

    • topology

      TypeStruct(topology)

      topology

      • max_overflow

        TypeInteger(0..+inf)
        Default0
        Description

        The maximum number of additional workers that can be created when all workers in the pool are busy. This helps to manage temporary spikes in workload by allowing more concurrent connections to the MongoDB server.

      • overflow_ttl

        TypeDuration
        Description

        Period of time before workers that exceed the configured pool size ("overflow") to be terminated.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • overflow_check_period

        TypeDuration
        Description

        Period for checking if there are more workers than configured ("overflow").
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • local_threshold_ms

        TypeDuration
        Description

        The size of the latency window for selecting among multiple suitable MongoDB instances.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • connect_timeout_ms

        TypeDuration
        Description

        The duration to attempt a connection before timing out.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • socket_timeout_ms

        TypeDuration
        Description

        The duration to attempt to send or to receive on a socket before the attempt times out.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • server_selection_timeout_ms

        TypeDuration
        Description

        Specifies how long to block for server selection before throwing an exception.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • wait_queue_timeout_ms

        TypeDuration
        Description

        The maximum duration that a worker can wait for a connection to become available.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • heartbeat_frequency_ms

        TypeDuration
        Default"200s"
        Description

        Controls when the driver checks the state of the MongoDB deployment. Specify the interval between checks, counted from the end of the previous check until the beginning of the next one. If the number of connections is increased (which will happen, for example, if you increase the pool size), you may need to increase this period as well to avoid creating too many log entries in the MongoDB log file.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • min_heartbeat_frequency_ms

        TypeDuration
        Description

        Controls the minimum amount of time to wait between heartbeats.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • ssl

      TypeStruct(ssl_client_opts)
      Default{enable = false}
      Description

      SSL connection settings.

      ssl_client_opts

      • cacertfile

        TypeString
        Description

        Trusted PEM format CA certificates bundle file.
        The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
        NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

      • cacerts

        TypeBoolean
        Description

        Deprecated since 5.1.4.

      • certfile

        TypeString
        Description

        PEM format certificates chain file.
        The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

      • keyfile

        TypeString
        Description

        PEM format private key file.

      • verify

        TypeEnum(verify_peer,verify_none)
        Defaultverify_none
        Description

        Enable or disable peer verification.

      • reuse_sessions

        TypeBoolean
        Defaulttrue
        Description

        Enable TLS session reuse.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • depth

        TypeInteger(0..+inf)
        Default10
        Description

        Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
        if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
        if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

      • password

        TypeString
        Description

        String containing the user's password. Only used if the private key file is password-protected.

      • versions

        TypeArray(String)
        Default["tlsv1.3", "tlsv1.2"]
        Description

        All TLS/DTLS versions to be supported.
        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
        In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

      • ciphers

        TypeArray(String)
        Default[]
        Description

        This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
        Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

        The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

        NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
        If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
        PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

      • secure_renegotiate

        TypeBoolean
        Defaulttrue
        Description

        SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • log_level

        TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
        Defaultnotice
        Description

        Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

      • hibernate_after

        TypeDuration
        Default"5s"
        Description

        Hibernate the SSL process after idling for amount of time reducing its memory footprint.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable TLS.

      • server_name_indication

        TypeOneOf(String("disable"),String)
        Description

        Specify the host name to be used in TLS Server Name Indication extension.
        For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
        If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
        The host name is then also used in the host name verification of the peer certificate.
        The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    redis_single

    • mechanism

      TypeString("password_based")
      Description

      Authentication mechanism.

    • backend

      TypeString("redis")
      Description

      Backend type.

    • cmd

      TypeString
      Description

      The Redis Command used to query data for authentication such as password hash, currently only supports HGET and HMGET.

    • password_hash_algorithm

      TypeOneOf(Struct(bcrypt),Struct(pbkdf2),Struct(simple))
      Default{name = sha256, salt_position = prefix}
      Description

      Options for password hash verification.

      bcrypt

      • name

        TypeString("bcrypt")
        Description

        BCRYPT password hashing.

      pbkdf2

      • name

        TypeString("pbkdf2")
        Description

        PBKDF2 password hashing.

      • mac_fun

        TypeEnum(md4,md5,ripemd160,sha,sha224,sha256,sha384,sha512)
        Description

        Specifies mac_fun for PBKDF2 hashing algorithm.

      • iterations

        TypeInteger(1..+inf)
        Description

        Iteration count for PBKDF2 hashing algorithm.

      • dk_length

        TypeInteger
        Description

        Derived length for PBKDF2 hashing algorithm. If not specified, calculated automatically based on mac_fun.

      simple

      • name

        TypeEnum(plain,md5,sha,sha256,sha512)
        Description

        Simple password hashing algorithm.

      • salt_position

        TypeEnum(disable,prefix,suffix)
        Defaultprefix
        Description

        Salt position for PLAIN, MD5, SHA, SHA256 and SHA512 algorithms.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    • server

      TypeString
      Description

      The IPv4 or IPv6 address or the hostname to connect to.
      A host entry has the following form: Host[:Port].
      The Redis default port 6379 is used if [:Port] is not specified.

    • redis_type

      TypeString("single")
      Defaultsingle
      Description

      Single mode. Must be set to 'single' when Redis server is running in single mode.

    • pool_size

      TypeInteger(1..+inf)
      Default8
      Description

      Size of the connection pool towards the bridge target service.

    • username

      TypeString
      Description

      The username associated with the bridge in the external database used for authentication or identification purposes.

    • password

      TypeSecret
      Description

      The password associated with the bridge, used for authentication with the external database.
      A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

    • database

      TypeInteger(0..+inf)
      Default0
      Description

      Redis database ID.

    • auto_reconnect

      TypeBoolean
      Description

      Deprecated since v5.0.15.

    • ssl

      TypeStruct(ssl_client_opts)
      Default{enable = false}
      Description

      SSL connection settings.

      ssl_client_opts

      • cacertfile

        TypeString
        Description

        Trusted PEM format CA certificates bundle file.
        The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
        NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

      • cacerts

        TypeBoolean
        Description

        Deprecated since 5.1.4.

      • certfile

        TypeString
        Description

        PEM format certificates chain file.
        The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

      • keyfile

        TypeString
        Description

        PEM format private key file.

      • verify

        TypeEnum(verify_peer,verify_none)
        Defaultverify_none
        Description

        Enable or disable peer verification.

      • reuse_sessions

        TypeBoolean
        Defaulttrue
        Description

        Enable TLS session reuse.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • depth

        TypeInteger(0..+inf)
        Default10
        Description

        Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
        if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
        if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

      • password

        TypeString
        Description

        String containing the user's password. Only used if the private key file is password-protected.

      • versions

        TypeArray(String)
        Default["tlsv1.3", "tlsv1.2"]
        Description

        All TLS/DTLS versions to be supported.
        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
        In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

      • ciphers

        TypeArray(String)
        Default[]
        Description

        This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
        Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

        The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

        NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
        If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
        PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

      • secure_renegotiate

        TypeBoolean
        Defaulttrue
        Description

        SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • log_level

        TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
        Defaultnotice
        Description

        Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

      • hibernate_after

        TypeDuration
        Default"5s"
        Description

        Hibernate the SSL process after idling for amount of time reducing its memory footprint.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable TLS.

      • server_name_indication

        TypeOneOf(String("disable"),String)
        Description

        Specify the host name to be used in TLS Server Name Indication extension.
        For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
        If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
        The host name is then also used in the host name verification of the peer certificate.
        The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    redis_cluster

    • mechanism

      TypeString("password_based")
      Description

      Authentication mechanism.

    • backend

      TypeString("redis")
      Description

      Backend type.

    • cmd

      TypeString
      Description

      The Redis Command used to query data for authentication such as password hash, currently only supports HGET and HMGET.

    • password_hash_algorithm

      TypeOneOf(Struct(bcrypt),Struct(pbkdf2),Struct(simple))
      Default{name = sha256, salt_position = prefix}
      Description

      Options for password hash verification.

      bcrypt

      • name

        TypeString("bcrypt")
        Description

        BCRYPT password hashing.

      pbkdf2

      • name

        TypeString("pbkdf2")
        Description

        PBKDF2 password hashing.

      • mac_fun

        TypeEnum(md4,md5,ripemd160,sha,sha224,sha256,sha384,sha512)
        Description

        Specifies mac_fun for PBKDF2 hashing algorithm.

      • iterations

        TypeInteger(1..+inf)
        Description

        Iteration count for PBKDF2 hashing algorithm.

      • dk_length

        TypeInteger
        Description

        Derived length for PBKDF2 hashing algorithm. If not specified, calculated automatically based on mac_fun.

      simple

      • name

        TypeEnum(plain,md5,sha,sha256,sha512)
        Description

        Simple password hashing algorithm.

      • salt_position

        TypeEnum(disable,prefix,suffix)
        Defaultprefix
        Description

        Salt position for PLAIN, MD5, SHA, SHA256 and SHA512 algorithms.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    • servers

      TypeString
      Description

      A Node list for Cluster to connect to. The nodes should be separated with commas, such as: Node[,Node]. For each Node should be: The IPv4 or IPv6 address or the hostname to connect to. A host entry has the following form: Host[:Port]. The Redis default port 6379 is used if [:Port] is not specified.

    • redis_type

      TypeString("cluster")
      Defaultcluster
      Description

      Cluster mode. Must be set to 'cluster' when Redis server is running in clustered mode.

    • pool_size

      TypeInteger(1..+inf)
      Default8
      Description

      Size of the connection pool towards the bridge target service.

    • username

      TypeString
      Description

      The username associated with the bridge in the external database used for authentication or identification purposes.

    • password

      TypeSecret
      Description

      The password associated with the bridge, used for authentication with the external database.
      A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

    • auto_reconnect

      TypeBoolean
      Description

      Deprecated since v5.0.15.

    • ssl

      TypeStruct(ssl_client_opts)
      Default{enable = false}
      Description

      SSL connection settings.

      ssl_client_opts

      • cacertfile

        TypeString
        Description

        Trusted PEM format CA certificates bundle file.
        The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
        NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

      • cacerts

        TypeBoolean
        Description

        Deprecated since 5.1.4.

      • certfile

        TypeString
        Description

        PEM format certificates chain file.
        The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

      • keyfile

        TypeString
        Description

        PEM format private key file.

      • verify

        TypeEnum(verify_peer,verify_none)
        Defaultverify_none
        Description

        Enable or disable peer verification.

      • reuse_sessions

        TypeBoolean
        Defaulttrue
        Description

        Enable TLS session reuse.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • depth

        TypeInteger(0..+inf)
        Default10
        Description

        Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
        if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
        if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

      • password

        TypeString
        Description

        String containing the user's password. Only used if the private key file is password-protected.

      • versions

        TypeArray(String)
        Default["tlsv1.3", "tlsv1.2"]
        Description

        All TLS/DTLS versions to be supported.
        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
        In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

      • ciphers

        TypeArray(String)
        Default[]
        Description

        This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
        Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

        The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

        NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
        If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
        PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

      • secure_renegotiate

        TypeBoolean
        Defaulttrue
        Description

        SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • log_level

        TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
        Defaultnotice
        Description

        Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

      • hibernate_after

        TypeDuration
        Default"5s"
        Description

        Hibernate the SSL process after idling for amount of time reducing its memory footprint.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable TLS.

      • server_name_indication

        TypeOneOf(String("disable"),String)
        Description

        Specify the host name to be used in TLS Server Name Indication extension.
        For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
        If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
        The host name is then also used in the host name verification of the peer certificate.
        The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    redis_sentinel

    • mechanism

      TypeString("password_based")
      Description

      Authentication mechanism.

    • backend

      TypeString("redis")
      Description

      Backend type.

    • cmd

      TypeString
      Description

      The Redis Command used to query data for authentication such as password hash, currently only supports HGET and HMGET.

    • password_hash_algorithm

      TypeOneOf(Struct(bcrypt),Struct(pbkdf2),Struct(simple))
      Default{name = sha256, salt_position = prefix}
      Description

      Options for password hash verification.

      bcrypt

      • name

        TypeString("bcrypt")
        Description

        BCRYPT password hashing.

      pbkdf2

      • name

        TypeString("pbkdf2")
        Description

        PBKDF2 password hashing.

      • mac_fun

        TypeEnum(md4,md5,ripemd160,sha,sha224,sha256,sha384,sha512)
        Description

        Specifies mac_fun for PBKDF2 hashing algorithm.

      • iterations

        TypeInteger(1..+inf)
        Description

        Iteration count for PBKDF2 hashing algorithm.

      • dk_length

        TypeInteger
        Description

        Derived length for PBKDF2 hashing algorithm. If not specified, calculated automatically based on mac_fun.

      simple

      • name

        TypeEnum(plain,md5,sha,sha256,sha512)
        Description

        Simple password hashing algorithm.

      • salt_position

        TypeEnum(disable,prefix,suffix)
        Defaultprefix
        Description

        Salt position for PLAIN, MD5, SHA, SHA256 and SHA512 algorithms.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    • servers

      TypeString
      Description

      A Node list for Cluster to connect to. The nodes should be separated with commas, such as: Node[,Node]. For each Node should be: The IPv4 or IPv6 address or the hostname to connect to. A host entry has the following form: Host[:Port]. The Redis default port 6379 is used if [:Port] is not specified.

    • redis_type

      TypeString("sentinel")
      Defaultsentinel
      Description

      Sentinel mode. Must be set to 'sentinel' when Redis server is running in sentinel mode.

    • sentinel

      TypeString
      Description

      The cluster name in Redis sentinel mode.

    • pool_size

      TypeInteger(1..+inf)
      Default8
      Description

      Size of the connection pool towards the bridge target service.

    • username

      TypeString
      Description

      The username associated with the bridge in the external database used for authentication or identification purposes.

    • password

      TypeSecret
      Description

      The password associated with the bridge, used for authentication with the external database.
      A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

    • database

      TypeInteger(0..+inf)
      Default0
      Description

      Redis database ID.

    • auto_reconnect

      TypeBoolean
      Description

      Deprecated since v5.0.15.

    • ssl

      TypeStruct(ssl_client_opts)
      Default{enable = false}
      Description

      SSL connection settings.

      ssl_client_opts

      • cacertfile

        TypeString
        Description

        Trusted PEM format CA certificates bundle file.
        The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
        NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

      • cacerts

        TypeBoolean
        Description

        Deprecated since 5.1.4.

      • certfile

        TypeString
        Description

        PEM format certificates chain file.
        The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

      • keyfile

        TypeString
        Description

        PEM format private key file.

      • verify

        TypeEnum(verify_peer,verify_none)
        Defaultverify_none
        Description

        Enable or disable peer verification.

      • reuse_sessions

        TypeBoolean
        Defaulttrue
        Description

        Enable TLS session reuse.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • depth

        TypeInteger(0..+inf)
        Default10
        Description

        Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
        if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
        if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

      • password

        TypeString
        Description

        String containing the user's password. Only used if the private key file is password-protected.

      • versions

        TypeArray(String)
        Default["tlsv1.3", "tlsv1.2"]
        Description

        All TLS/DTLS versions to be supported.
        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
        In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

      • ciphers

        TypeArray(String)
        Default[]
        Description

        This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
        Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

        The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

        NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
        If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
        PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

      • secure_renegotiate

        TypeBoolean
        Defaulttrue
        Description

        SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • log_level

        TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
        Defaultnotice
        Description

        Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

      • hibernate_after

        TypeDuration
        Default"5s"
        Description

        Hibernate the SSL process after idling for amount of time reducing its memory footprint.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable TLS.

      • server_name_indication

        TypeOneOf(String("disable"),String)
        Description

        Specify the host name to be used in TLS Server Name Indication extension.
        For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
        If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
        The host name is then also used in the host name verification of the peer certificate.
        The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    http_get

    • method

      TypeString("get")
      Description

      HTTP request method.

    • headers

      TypeMap
      Default{accept = "application/json", cache-control = "no-cache", connection = "keep-alive", keep-alive = "timeout=30, max=1000"}
      Description

      List of HTTP headers (without content-type).

    • mechanism

      TypeString("password_based")
      Description

      Authentication mechanism.

    • backend

      TypeString("http")
      Description

      Backend type.

    • url

      TypeString
      Description

      URL of the HTTP server.

    • body

      TypeMap
      Description

      HTTP request body.

    • request_timeout

      TypeDuration
      Default"5s"
      Description

      HTTP request timeout.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    • request

      TypeStruct(request)
      Description

      Configure HTTP request parameters.

      request

      • method

        TypeString
        Description

        HTTP method.

      • path

        TypeString
        Description

        URL path.
        A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

      • body

        TypeString
        Description

        HTTP request body.
        A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

      • headers

        TypeMap
        Description

        List of HTTP headers.

      • max_retries

        TypeInteger(0..+inf)
        Description

        Max retry times if error on sending request.

      • request_timeout

        TypeDuration
        Description

        HTTP request timeout.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • ssl

      TypeStruct(ssl_client_opts)
      Default{enable = false}
      Description

      SSL connection settings.

      ssl_client_opts

      • cacertfile

        TypeString
        Description

        Trusted PEM format CA certificates bundle file.
        The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
        NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

      • cacerts

        TypeBoolean
        Description

        Deprecated since 5.1.4.

      • certfile

        TypeString
        Description

        PEM format certificates chain file.
        The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

      • keyfile

        TypeString
        Description

        PEM format private key file.

      • verify

        TypeEnum(verify_peer,verify_none)
        Defaultverify_none
        Description

        Enable or disable peer verification.

      • reuse_sessions

        TypeBoolean
        Defaulttrue
        Description

        Enable TLS session reuse.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • depth

        TypeInteger(0..+inf)
        Default10
        Description

        Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
        if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
        if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

      • password

        TypeString
        Description

        String containing the user's password. Only used if the private key file is password-protected.

      • versions

        TypeArray(String)
        Default["tlsv1.3", "tlsv1.2"]
        Description

        All TLS/DTLS versions to be supported.
        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
        In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

      • ciphers

        TypeArray(String)
        Default[]
        Description

        This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
        Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

        The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

        NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
        If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
        PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

      • secure_renegotiate

        TypeBoolean
        Defaulttrue
        Description

        SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • log_level

        TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
        Defaultnotice
        Description

        Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

      • hibernate_after

        TypeDuration
        Default"5s"
        Description

        Hibernate the SSL process after idling for amount of time reducing its memory footprint.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable TLS.

      • server_name_indication

        TypeOneOf(String("disable"),String)
        Description

        Specify the host name to be used in TLS Server Name Indication extension.
        For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
        If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
        The host name is then also used in the host name verification of the peer certificate.
        The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    • pool_size

      TypeInteger(1..+inf)
      Default8
      Description

      The pool size.

    • connect_timeout

      TypeDuration
      Default"15s"
      Description

      The timeout when connecting to the HTTP server.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • max_retries

      TypeInteger(0..+inf)
      Description

      Deprecated since 5.0.4.

    • enable_pipelining

      TypeInteger(1..+inf)
      Default100
      Description

      A positive integer. Whether to send HTTP requests continuously, when set to 1, it means that after each HTTP request is sent, you need to wait for the server to return and then continue to send the next request.

    • retry_interval

      TypeDuration
      Description

      Deprecated since 5.0.4.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    http_post

    • method

      TypeString("post")
      Description

      HTTP request method.

    • headers

      TypeMap
      Default{accept = "application/json", cache-control = "no-cache", connection = "keep-alive", content-type = "application/json", keep-alive = "timeout=30, max=1000"}
      Description

      List of HTTP Headers.

    • mechanism

      TypeString("password_based")
      Description

      Authentication mechanism.

    • backend

      TypeString("http")
      Description

      Backend type.

    • url

      TypeString
      Description

      URL of the HTTP server.

    • body

      TypeMap
      Description

      HTTP request body.

    • request_timeout

      TypeDuration
      Default"5s"
      Description

      HTTP request timeout.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    • request

      TypeStruct(request)
      Description

      Configure HTTP request parameters.

      request

      • method

        TypeString
        Description

        HTTP method.

      • path

        TypeString
        Description

        URL path.
        A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

      • body

        TypeString
        Description

        HTTP request body.
        A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

      • headers

        TypeMap
        Description

        List of HTTP headers.

      • max_retries

        TypeInteger(0..+inf)
        Description

        Max retry times if error on sending request.

      • request_timeout

        TypeDuration
        Description

        HTTP request timeout.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • ssl

      TypeStruct(ssl_client_opts)
      Default{enable = false}
      Description

      SSL connection settings.

      ssl_client_opts

      • cacertfile

        TypeString
        Description

        Trusted PEM format CA certificates bundle file.
        The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
        NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

      • cacerts

        TypeBoolean
        Description

        Deprecated since 5.1.4.

      • certfile

        TypeString
        Description

        PEM format certificates chain file.
        The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

      • keyfile

        TypeString
        Description

        PEM format private key file.

      • verify

        TypeEnum(verify_peer,verify_none)
        Defaultverify_none
        Description

        Enable or disable peer verification.

      • reuse_sessions

        TypeBoolean
        Defaulttrue
        Description

        Enable TLS session reuse.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • depth

        TypeInteger(0..+inf)
        Default10
        Description

        Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
        if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
        if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

      • password

        TypeString
        Description

        String containing the user's password. Only used if the private key file is password-protected.

      • versions

        TypeArray(String)
        Default["tlsv1.3", "tlsv1.2"]
        Description

        All TLS/DTLS versions to be supported.
        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
        In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

      • ciphers

        TypeArray(String)
        Default[]
        Description

        This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
        Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

        The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

        NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
        If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
        PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

      • secure_renegotiate

        TypeBoolean
        Defaulttrue
        Description

        SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • log_level

        TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
        Defaultnotice
        Description

        Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

      • hibernate_after

        TypeDuration
        Default"5s"
        Description

        Hibernate the SSL process after idling for amount of time reducing its memory footprint.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable TLS.

      • server_name_indication

        TypeOneOf(String("disable"),String)
        Description

        Specify the host name to be used in TLS Server Name Indication extension.
        For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
        If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
        The host name is then also used in the host name verification of the peer certificate.
        The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    • pool_size

      TypeInteger(1..+inf)
      Default8
      Description

      The pool size.

    • connect_timeout

      TypeDuration
      Default"15s"
      Description

      The timeout when connecting to the HTTP server.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • max_retries

      TypeInteger(0..+inf)
      Description

      Deprecated since 5.0.4.

    • enable_pipelining

      TypeInteger(1..+inf)
      Default100
      Description

      A positive integer. Whether to send HTTP requests continuously, when set to 1, it means that after each HTTP request is sent, you need to wait for the server to return and then continue to send the next request.

    • retry_interval

      TypeDuration
      Description

      Deprecated since 5.0.4.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    jwt_hmac

    • algorithm

      TypeEnum(hmac-based)
      Description

      JWT signing algorithm, Supports HMAC (configured as hmac-based) and RSA, ECDSA (configured as public-key).

    • secret

      TypeString
      Description

      The key to verify the JWT using HMAC algorithm.

    • secret_base64_encoded

      TypeBoolean
      Defaultfalse
      Description

      Whether secret is base64 encoded.

    • mechanism

      TypeString("jwt")
      Description

      Authentication mechanism.

    • acl_claim_name

      TypeString
      Defaultacl
      Description

      The JWT claim designated for accessing ACL (Access Control List) rules can be specified, such as using the acl claim. A typical decoded JWT with this claim might appear as: {"username": "user1", "acl": ...}.

      Supported ACL Rule Formats:

      • Object Format: Utilizes action types pub (publish), sub (subscribe), or all (both publish and subscribe). The value is a list of topic filters. Example: {"pub": ["topic1"], "sub": [], "all": ["${username}/#"]}. This example signifies that the token owner can publish to topic1 and perform both publish and subscribe actions on topics starting with their username. Note: In this format, if no topic matches, the action is denied, and the authorization process terminates.

      • Array Format (resembles File-Based ACL Rules): Example: [{"permission": "allow", "action": "all", "topic": "${username}/#"}]. Additionally, the pub or publish action rules can be extended with qos and retain field, and sub or subscribe action rules can be extended with a qos field. Note: Here, if no rule matches, the action is not immediately denied. The process continues to other configured authorization sources, and ultimately falls back to the default permission in config authorization.no_match.

      The ACL claim utilizes MQTT topic wildcard matching rules for publishing or subscribing. A special syntax for the 'subscribe' action allows the use of eq for an exact match. For instance, eq t/# permits or denies subscription to t/#, but not to t/1.

    • verify_claims

      TypeMap
      Default[]
      Description

      A list of custom claims to validate, which is a list of name/value pairs. Values can use the following placeholders:

      • ${username}: Will be replaced at runtime with Username used by the client when connecting
      • ${clientid}: Will be replaced at runtime with Client ID used by the client when connecting Authentication will verify that the value of claims in the JWT (taken from the Password field) matches what is required in verify_claims.
    • disconnect_after_expire

      TypeBoolean
      Defaulttrue
      Description

      Disconnect the client after the token expires.

    • from

      TypeEnum(username,password)
      Defaultpassword
      Description

      Field to take JWT from.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    jwt_public_key

    • algorithm

      TypeEnum(public-key)
      Description

      JWT signing algorithm, Supports HMAC (configured as hmac-based) and RSA, ECDSA (configured as public-key).

    • public_key

      TypeString
      Description

      The public key used to verify the JWT.

    • mechanism

      TypeString("jwt")
      Description

      Authentication mechanism.

    • acl_claim_name

      TypeString
      Defaultacl
      Description

      The JWT claim designated for accessing ACL (Access Control List) rules can be specified, such as using the acl claim. A typical decoded JWT with this claim might appear as: {"username": "user1", "acl": ...}.

      Supported ACL Rule Formats:

      • Object Format: Utilizes action types pub (publish), sub (subscribe), or all (both publish and subscribe). The value is a list of topic filters. Example: {"pub": ["topic1"], "sub": [], "all": ["${username}/#"]}. This example signifies that the token owner can publish to topic1 and perform both publish and subscribe actions on topics starting with their username. Note: In this format, if no topic matches, the action is denied, and the authorization process terminates.

      • Array Format (resembles File-Based ACL Rules): Example: [{"permission": "allow", "action": "all", "topic": "${username}/#"}]. Additionally, the pub or publish action rules can be extended with qos and retain field, and sub or subscribe action rules can be extended with a qos field. Note: Here, if no rule matches, the action is not immediately denied. The process continues to other configured authorization sources, and ultimately falls back to the default permission in config authorization.no_match.

      The ACL claim utilizes MQTT topic wildcard matching rules for publishing or subscribing. A special syntax for the 'subscribe' action allows the use of eq for an exact match. For instance, eq t/# permits or denies subscription to t/#, but not to t/1.

    • verify_claims

      TypeMap
      Default[]
      Description

      A list of custom claims to validate, which is a list of name/value pairs. Values can use the following placeholders:

      • ${username}: Will be replaced at runtime with Username used by the client when connecting
      • ${clientid}: Will be replaced at runtime with Client ID used by the client when connecting Authentication will verify that the value of claims in the JWT (taken from the Password field) matches what is required in verify_claims.
    • disconnect_after_expire

      TypeBoolean
      Defaulttrue
      Description

      Disconnect the client after the token expires.

    • from

      TypeEnum(username,password)
      Defaultpassword
      Description

      Field to take JWT from.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    jwt_jwks

    • use_jwks

      TypeEnum(true)
      Description

      Whether to use JWKS.

    • endpoint

      TypeString
      Description

      JWKS endpoint, it's a read-only endpoint that returns the server's public key set in the JWKS format.

    • pool_size

      TypeInteger(1..+inf)
      Default8
      Description

      Size of the connection pool towards the bridge target service.

    • refresh_interval

      TypeInteger
      Default300
      Description

      JWKS refresh interval.

    • ssl

      TypeStruct(ssl_client_opts)
      Default{enable = false}
      Description

      SSL options.

      ssl_client_opts

      • cacertfile

        TypeString
        Description

        Trusted PEM format CA certificates bundle file.
        The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
        NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

      • cacerts

        TypeBoolean
        Description

        Deprecated since 5.1.4.

      • certfile

        TypeString
        Description

        PEM format certificates chain file.
        The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

      • keyfile

        TypeString
        Description

        PEM format private key file.

      • verify

        TypeEnum(verify_peer,verify_none)
        Defaultverify_none
        Description

        Enable or disable peer verification.

      • reuse_sessions

        TypeBoolean
        Defaulttrue
        Description

        Enable TLS session reuse.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • depth

        TypeInteger(0..+inf)
        Default10
        Description

        Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
        if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
        if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

      • password

        TypeString
        Description

        String containing the user's password. Only used if the private key file is password-protected.

      • versions

        TypeArray(String)
        Default["tlsv1.3", "tlsv1.2"]
        Description

        All TLS/DTLS versions to be supported.
        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
        In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

      • ciphers

        TypeArray(String)
        Default[]
        Description

        This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
        Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

        The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

        NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
        If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
        PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

      • secure_renegotiate

        TypeBoolean
        Defaulttrue
        Description

        SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • log_level

        TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
        Defaultnotice
        Description

        Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

      • hibernate_after

        TypeDuration
        Default"5s"
        Description

        Hibernate the SSL process after idling for amount of time reducing its memory footprint.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable TLS.

      • server_name_indication

        TypeOneOf(String("disable"),String)
        Description

        Specify the host name to be used in TLS Server Name Indication extension.
        For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
        If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
        The host name is then also used in the host name verification of the peer certificate.
        The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    • mechanism

      TypeString("jwt")
      Description

      Authentication mechanism.

    • acl_claim_name

      TypeString
      Defaultacl
      Description

      The JWT claim designated for accessing ACL (Access Control List) rules can be specified, such as using the acl claim. A typical decoded JWT with this claim might appear as: {"username": "user1", "acl": ...}.

      Supported ACL Rule Formats:

      • Object Format: Utilizes action types pub (publish), sub (subscribe), or all (both publish and subscribe). The value is a list of topic filters. Example: {"pub": ["topic1"], "sub": [], "all": ["${username}/#"]}. This example signifies that the token owner can publish to topic1 and perform both publish and subscribe actions on topics starting with their username. Note: In this format, if no topic matches, the action is denied, and the authorization process terminates.

      • Array Format (resembles File-Based ACL Rules): Example: [{"permission": "allow", "action": "all", "topic": "${username}/#"}]. Additionally, the pub or publish action rules can be extended with qos and retain field, and sub or subscribe action rules can be extended with a qos field. Note: Here, if no rule matches, the action is not immediately denied. The process continues to other configured authorization sources, and ultimately falls back to the default permission in config authorization.no_match.

      The ACL claim utilizes MQTT topic wildcard matching rules for publishing or subscribing. A special syntax for the 'subscribe' action allows the use of eq for an exact match. For instance, eq t/# permits or denies subscription to t/#, but not to t/1.

    • verify_claims

      TypeMap
      Default[]
      Description

      A list of custom claims to validate, which is a list of name/value pairs. Values can use the following placeholders:

      • ${username}: Will be replaced at runtime with Username used by the client when connecting
      • ${clientid}: Will be replaced at runtime with Client ID used by the client when connecting Authentication will verify that the value of claims in the JWT (taken from the Password field) matches what is required in verify_claims.
    • disconnect_after_expire

      TypeBoolean
      Defaulttrue
      Description

      Disconnect the client after the token expires.

    • from

      TypeEnum(username,password)
      Defaultpassword
      Description

      Field to take JWT from.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    scram

    • mechanism

      TypeString("scram")
      Description

      Authentication mechanism.

    • backend

      TypeString("built_in_database")
      Description

      Backend type.

    • algorithm

      TypeEnum(sha256,sha512)
      Defaultsha256
      Description

      Hashing algorithm.

    • iteration_count

      TypeInteger(0..+inf)
      Default4096
      Description

      Iteration count.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    ldap

    • mechanism

      TypeString("password_based")
      Description

      Authentication mechanism.

    • backend

      TypeString("ldap")
      Description

      Backend type.

    • query_timeout

      TypeDuration
      Default"5s"
      Description

      Timeout for the LDAP query.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    • server

      TypeString
      Description

      The IPv4 or IPv6 address or the hostname to connect to.
      A host entry has the following form: Host[:Port].
      The LDAP default port 389 is used if [:Port] is not specified.

    • pool_size

      TypeInteger(1..+inf)
      Default8
      Description

      Size of the connection pool towards the bridge target service.

    • username

      TypeString
      Description

      The username associated with the bridge in the external database used for authentication or identification purposes.

    • password

      TypeSecret
      Description

      The password associated with the bridge, used for authentication with the external database.
      A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

    • base_dn

      TypeString
      Description

      The name of the base object entry (or possibly the root) relative to which the Search is to be performed.

    • filter

      TypeString
      Default"(objectClass=mqttUser)"
      Description

      The filter that defines the conditions that must be fulfilled in order for the Search to match a given entry.
      The syntax of the filter follows RFC 4515 and also supports placeholders.

    • request_timeout

      TypeDuration
      Default"10s"
      Description

      Sets the maximum time in milliseconds that is used for each individual request.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • ssl

      TypeStruct(ssl)
      Default{enable = false}
      Description

      SSL connection settings.

      ssl

      • cacertfile

        TypeString
        Description

        Trusted PEM format CA certificates bundle file.
        The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
        NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

      • cacerts

        TypeBoolean
        Description

        Deprecated since 5.1.4.

      • certfile

        TypeString
        Description

        PEM format certificates chain file.
        The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

      • keyfile

        TypeString
        Description

        PEM format private key file.

      • verify

        TypeEnum(verify_peer,verify_none)
        Defaultverify_none
        Description

        Enable or disable peer verification.

      • reuse_sessions

        TypeBoolean
        Defaulttrue
        Description

        Enable TLS session reuse.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • depth

        TypeInteger(0..+inf)
        Default10
        Description

        Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
        if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
        if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

      • password

        TypeString
        Description

        String containing the user's password. Only used if the private key file is password-protected.

      • versions

        TypeArray(String)
        Default["tlsv1.3", "tlsv1.2"]
        Description

        All TLS/DTLS versions to be supported.
        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
        In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

      • ciphers

        TypeArray(String)
        Default[]
        Description

        This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
        Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

        The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

        NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
        If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
        PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

      • secure_renegotiate

        TypeBoolean
        Defaulttrue
        Description

        SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • log_level

        TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
        Defaultnotice
        Description

        Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

      • hibernate_after

        TypeDuration
        Default"5s"
        Description

        Hibernate the SSL process after idling for amount of time reducing its memory footprint.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable TLS.

      • server_name_indication

        TypeOneOf(String("disable"),String)
        Description

        Specify the host name to be used in TLS Server Name Indication extension.
        For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
        If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
        The host name is then also used in the host name verification of the peer certificate.
        The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    • method

      TypeOneOf(Struct(hash_method),Struct(bind_method))
      Description

      Authentication method.

      hash_method

      • type

        TypeEnum(hash)
        Defaulthash
        Description

        Authentication method type.

      • password_attribute

        TypeString
        DefaultuserPassword
        Description

        Indicates which attribute is used to represent the user's password.

      • is_superuser_attribute

        TypeString
        DefaultisSuperuser
        Description

        Indicates which attribute is used to represent whether the user is a superuser.

      bind_method

      • type

        TypeEnum(bind)
        Defaultbind
        Description

        Authentication method type.

      • bind_password

        TypeString
        Default"${password}"
        Description

        The template for password to bind.

    ldap_deprecated

    • mechanism

      TypeString("password_based")
      Description

      Authentication mechanism.

    • backend

      TypeString("ldap")
      Description

      Backend type.

    • query_timeout

      TypeDuration
      Default"5s"
      Description

      Timeout for the LDAP query.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Set to true or false to disable this auth provider.

    • server

      TypeString
      Description

      The IPv4 or IPv6 address or the hostname to connect to.
      A host entry has the following form: Host[:Port].
      The LDAP default port 389 is used if [:Port] is not specified.

    • pool_size

      TypeInteger(1..+inf)
      Default8
      Description

      Size of the connection pool towards the bridge target service.

    • username

      TypeString
      Description

      The username associated with the bridge in the external database used for authentication or identification purposes.

    • password

      TypeSecret
      Description

      The password associated with the bridge, used for authentication with the external database.
      A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

    • base_dn

      TypeString
      Description

      The name of the base object entry (or possibly the root) relative to which the Search is to be performed.

    • filter

      TypeString
      Default"(objectClass=mqttUser)"
      Description

      The filter that defines the conditions that must be fulfilled in order for the Search to match a given entry.
      The syntax of the filter follows RFC 4515 and also supports placeholders.

    • request_timeout

      TypeDuration
      Default"10s"
      Description

      Sets the maximum time in milliseconds that is used for each individual request.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • ssl

      TypeStruct(ssl)
      Default{enable = false}
      Description

      SSL connection settings.

      ssl

      • cacertfile

        TypeString
        Description

        Trusted PEM format CA certificates bundle file.
        The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
        NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

      • cacerts

        TypeBoolean
        Description

        Deprecated since 5.1.4.

      • certfile

        TypeString
        Description

        PEM format certificates chain file.
        The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

      • keyfile

        TypeString
        Description

        PEM format private key file.

      • verify

        TypeEnum(verify_peer,verify_none)
        Defaultverify_none
        Description

        Enable or disable peer verification.

      • reuse_sessions

        TypeBoolean
        Defaulttrue
        Description

        Enable TLS session reuse.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • depth

        TypeInteger(0..+inf)
        Default10
        Description

        Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
        if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
        if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

      • password

        TypeString
        Description

        String containing the user's password. Only used if the private key file is password-protected.

      • versions

        TypeArray(String)
        Default["tlsv1.3", "tlsv1.2"]
        Description

        All TLS/DTLS versions to be supported.
        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
        In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

      • ciphers

        TypeArray(String)
        Default[]
        Description

        This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
        Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

        The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

        NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

        NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
        If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
        PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

      • secure_renegotiate

        TypeBoolean
        Defaulttrue
        Description

        SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
        Has no effect when TLS version is configured (or negotiated) to 1.3

      • log_level

        TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
        Defaultnotice
        Description

        Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

      • hibernate_after

        TypeDuration
        Default"5s"
        Description

        Hibernate the SSL process after idling for amount of time reducing its memory footprint.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable TLS.

      • server_name_indication

        TypeOneOf(String("disable"),String)
        Description

        Specify the host name to be used in TLS Server Name Indication extension.
        For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
        If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
        The host name is then also used in the host name verification of the peer certificate.
        The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    • password_attribute

      TypeString
      DefaultuserPassword
      Description

      Indicates which attribute is used to represent the user's password.

    • is_superuser_attribute

      TypeString
      DefaultisSuperuser
      Description

      Indicates which attribute is used to represent whether the user is a superuser.

  • authorization

    TypeStruct(authorization)
    Description

    Authorization a.k.a. ACL.
    In EMQX, MQTT client access control is extremely flexible.
    An out-of-the-box set of authorization data sources are supported. For example,
    'file' source is to support concise and yet generic ACL rules in a file;
    'built_in_database' source can be used to store per-client customizable rule sets, natively in the EMQX node;
    'http' source to make EMQX call an external HTTP API to make the decision;
    'PostgreSQL' etc. to look up clients or rules from external databases

    authorization

    • no_match

      TypeEnum(allow,deny)
      Defaultallow
      Description

      Default access control action if the user or client matches no ACL rules, or if no such user or client is found by the configurable authorization sources such as built_in_database, an HTTP API, or a query against PostgreSQL. Find more details in 'authorization.sources' config.

    • deny_action

      TypeEnum(ignore,disconnect)
      Defaultignore
      Description

      The action when the authorization check rejects an operation.

    • cache

      TypeStruct(authz_cache)

      authz_cache

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Enable or disable the authorization cache.

      • max_size

        TypeInteger(1..1048576)
        Default32
        Description

        Maximum number of cached items.

      • ttl

        TypeDuration
        Default"1m"
        Description

        Time to live for the cached data.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • excludes

        TypeArray(String)
        Default[]
        Description

        Exclude caching ACL check results for topics matching the given patterns.

    • sources

      TypeArray(OneOf(Struct(file),Struct(builtin_db),Struct(http_get),Struct(http_post),Struct(redis_single),Struct(redis_sentinel),Struct(redis_cluster),Struct(mysql),Struct(postgresql),Struct(mongo_single),Struct(mongo_rs),Struct(mongo_sharded),Struct(ldap)))
      Default[{enable = true, path = "${EMQX_ETC_DIR}/acl.conf", type = file}]
      Description

      Authorization data sources.
      An array of authorization (ACL) data providers. It is designed as an array, not a hash-map, so the sources can be ordered to form a chain of access controls.

      When authorizing a 'publish' or 'subscribe' action, the configured sources are checked in order. When checking an ACL source, in case the client (identified by username or client ID) is not found, it moves on to the next source. And it stops immediately once an 'allow' or 'deny' decision is returned.

      If the client is not found in any of the sources, the default action configured in 'authorization.no_match' is applied.

      NOTE: The source elements are identified by their 'type'. It is NOT allowed to configure two or more sources of the same type.

      file

      • type

        TypeString("file")
        Description

        Backend type.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Set to true or false to disable this ACL provider

      • path

        TypeString
        Description

        Path to the file which contains the ACL rules. If the file provisioned before starting EMQX node, it can be placed anywhere as long as EMQX has read access to it. That is, EMQX will treat it as read only.

        In case the rule-set is created or updated from EMQX Dashboard or HTTP API, a new file will be created and placed in authz subdirectory inside EMQX's data_dir, and the old file will not be used anymore.

      builtin_db

      • type

        TypeString("built_in_database")
        Description

        Backend type.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Set to true or false to disable this ACL provider

      http_get

      • type

        TypeString("http")
        Description

        Backend type.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Set to true or false to disable this ACL provider

      • url

        TypeString
        Description

        URL of the auth server.

      • request_timeout

        TypeString
        Default"30s"
        Description

        HTTP request timeout.

      • body

        TypeMap($name->String)
        Description

        HTTP request body.

      • connect_timeout

        TypeDuration
        Default"15s"
        Description

        The timeout when connecting to the HTTP server.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • max_retries

        TypeInteger(0..+inf)
        Description

        Deprecated since 5.0.4.

      • retry_interval

        TypeDuration
        Description

        Deprecated since 5.0.4.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        The pool size.

      • enable_pipelining

        TypeInteger(1..+inf)
        Default100
        Description

        A positive integer. Whether to send HTTP requests continuously, when set to 1, it means that after each HTTP request is sent, you need to wait for the server to return and then continue to send the next request.

      • request

        TypeStruct(request)
        Description

        Configure HTTP request parameters.

        request

        • method
          TypeString
          Description

          HTTP method.

        • path
          TypeString
          Description

          URL path.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • body
          TypeString
          Description

          HTTP request body.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • headers
          TypeMap
          Description

          List of HTTP headers.

        • max_retries
          TypeInteger(0..+inf)
          Description

          Max retry times if error on sending request.

        • request_timeout
          TypeDuration
          Description

          HTTP request timeout.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • ssl

        TypeStruct(ssl_client_opts)
        Default{enable = false}
        Description

        SSL connection settings.

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

      • method

        TypeString("get")
        Description

        HTTP method.

      • headers

        TypeMap
        Default{accept = "application/json", cache-control = "no-cache", connection = "keep-alive", keep-alive = "timeout=30, max=1000"}
        Description

        List of HTTP headers (without content-type).

      http_post

      • type

        TypeString("http")
        Description

        Backend type.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Set to true or false to disable this ACL provider

      • url

        TypeString
        Description

        URL of the auth server.

      • request_timeout

        TypeString
        Default"30s"
        Description

        HTTP request timeout.

      • body

        TypeMap($name->String)
        Description

        HTTP request body.

      • connect_timeout

        TypeDuration
        Default"15s"
        Description

        The timeout when connecting to the HTTP server.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • max_retries

        TypeInteger(0..+inf)
        Description

        Deprecated since 5.0.4.

      • retry_interval

        TypeDuration
        Description

        Deprecated since 5.0.4.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        The pool size.

      • enable_pipelining

        TypeInteger(1..+inf)
        Default100
        Description

        A positive integer. Whether to send HTTP requests continuously, when set to 1, it means that after each HTTP request is sent, you need to wait for the server to return and then continue to send the next request.

      • request

        TypeStruct(request)
        Description

        Configure HTTP request parameters.

        request

        • method
          TypeString
          Description

          HTTP method.

        • path
          TypeString
          Description

          URL path.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • body
          TypeString
          Description

          HTTP request body.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • headers
          TypeMap
          Description

          List of HTTP headers.

        • max_retries
          TypeInteger(0..+inf)
          Description

          Max retry times if error on sending request.

        • request_timeout
          TypeDuration
          Description

          HTTP request timeout.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • ssl

        TypeStruct(ssl_client_opts)
        Default{enable = false}
        Description

        SSL connection settings.

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

      • method

        TypeString("post")
        Description

        HTTP method.

      • headers

        TypeMap
        Default{accept = "application/json", cache-control = "no-cache", connection = "keep-alive", content-type = "application/json", keep-alive = "timeout=30, max=1000"}
        Description

        List of HTTP Headers.

      redis_single

      • type

        TypeString("redis")
        Description

        Backend type.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Set to true or false to disable this ACL provider

      • server

        TypeString
        Description

        The IPv4 or IPv6 address or the hostname to connect to.
        A host entry has the following form: Host[:Port].
        The Redis default port 6379 is used if [:Port] is not specified.

      • redis_type

        TypeString("single")
        Defaultsingle
        Description

        Single mode. Must be set to 'single' when Redis server is running in single mode.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        Size of the connection pool towards the bridge target service.

      • username

        TypeString
        Description

        The username associated with the bridge in the external database used for authentication or identification purposes.

      • password

        TypeSecret
        Description

        The password associated with the bridge, used for authentication with the external database.
        A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

      • database

        TypeInteger(0..+inf)
        Default0
        Description

        Redis database ID.

      • auto_reconnect

        TypeBoolean
        Description

        Deprecated since v5.0.15.

      • ssl

        TypeStruct(ssl_client_opts)
        Default{enable = false}
        Description

        SSL connection settings.

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

      • cmd

        TypeString
        Description

        Database query used to retrieve authorization data.

      redis_sentinel

      • type

        TypeString("redis")
        Description

        Backend type.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Set to true or false to disable this ACL provider

      • servers

        TypeString
        Description

        A Node list for Cluster to connect to. The nodes should be separated with commas, such as: Node[,Node]. For each Node should be: The IPv4 or IPv6 address or the hostname to connect to. A host entry has the following form: Host[:Port]. The Redis default port 6379 is used if [:Port] is not specified.

      • redis_type

        TypeString("sentinel")
        Defaultsentinel
        Description

        Sentinel mode. Must be set to 'sentinel' when Redis server is running in sentinel mode.

      • sentinel

        TypeString
        Description

        The cluster name in Redis sentinel mode.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        Size of the connection pool towards the bridge target service.

      • username

        TypeString
        Description

        The username associated with the bridge in the external database used for authentication or identification purposes.

      • password

        TypeSecret
        Description

        The password associated with the bridge, used for authentication with the external database.
        A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

      • database

        TypeInteger(0..+inf)
        Default0
        Description

        Redis database ID.

      • auto_reconnect

        TypeBoolean
        Description

        Deprecated since v5.0.15.

      • ssl

        TypeStruct(ssl_client_opts)
        Default{enable = false}
        Description

        SSL connection settings.

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

      • cmd

        TypeString
        Description

        Database query used to retrieve authorization data.

      redis_cluster

      • type

        TypeString("redis")
        Description

        Backend type.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Set to true or false to disable this ACL provider

      • servers

        TypeString
        Description

        A Node list for Cluster to connect to. The nodes should be separated with commas, such as: Node[,Node]. For each Node should be: The IPv4 or IPv6 address or the hostname to connect to. A host entry has the following form: Host[:Port]. The Redis default port 6379 is used if [:Port] is not specified.

      • redis_type

        TypeString("cluster")
        Defaultcluster
        Description

        Cluster mode. Must be set to 'cluster' when Redis server is running in clustered mode.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        Size of the connection pool towards the bridge target service.

      • username

        TypeString
        Description

        The username associated with the bridge in the external database used for authentication or identification purposes.

      • password

        TypeSecret
        Description

        The password associated with the bridge, used for authentication with the external database.
        A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

      • auto_reconnect

        TypeBoolean
        Description

        Deprecated since v5.0.15.

      • ssl

        TypeStruct(ssl_client_opts)
        Default{enable = false}
        Description

        SSL connection settings.

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

      • cmd

        TypeString
        Description

        Database query used to retrieve authorization data.

      mysql

      • type

        TypeString("mysql")
        Description

        Backend type.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Set to true or false to disable this ACL provider

      • server

        TypeString
        Description

        The IPv4 or IPv6 address or the hostname to connect to.
        A host entry has the following form: Host[:Port].
        The MySQL default port 3306 is used if [:Port] is not specified.

      • database

        TypeString
        Description

        Database name.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        Size of the connection pool towards the bridge target service.

      • username

        TypeString
        Defaultroot
        Description

        The username associated with the bridge in the external database used for authentication or identification purposes.

      • password

        TypeSecret
        Description

        The password associated with the bridge, used for authentication with the external database.
        A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

      • auto_reconnect

        TypeBoolean
        Description

        Deprecated since v5.0.15.

      • ssl

        TypeStruct(ssl_client_opts)
        Default{enable = false}
        Description

        SSL connection settings.

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

      • prepare_statement

        TypeMap
        Description

        Key-value list of SQL prepared statements.

      • query

        TypeString
        Description

        Database query used to retrieve authorization data.

      postgresql

      • type

        TypeString("postgresql")
        Description

        Backend type.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Set to true or false to disable this ACL provider

      • server

        TypeString
        Description

        The IPv4 or IPv6 address or the hostname to connect to.
        A host entry has the following form: Host[:Port].
        The PostgreSQL default port 5432 is used if [:Port] is not specified.

      • disable_prepared_statements

        TypeBoolean
        Defaultfalse
        Description

        Disables the usage of prepared statements in the connections. Some endpoints, like PGBouncer or Supabase in Transaction mode, do not support session features such as prepared statements. For such connections, this option should be enabled.

      • database

        TypeString
        Description

        Database name.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        Size of the connection pool towards the bridge target service.

      • username

        TypeString
        Description

        The username associated with the bridge in the external database used for authentication or identification purposes.

      • password

        TypeSecret
        Description

        The password associated with the bridge, used for authentication with the external database.
        A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

      • auto_reconnect

        TypeBoolean
        Description

        Deprecated since v5.0.15.

      • ssl

        TypeStruct(ssl_client_opts)
        Default{enable = false}
        Description

        SSL connection settings.

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

      • prepare_statement

        TypeMap
        Description

        Key-value list of SQL prepared statements.

      • query

        TypeString
        Description

        Database query used to retrieve authorization data.

      mongo_single

      • type

        TypeString("mongodb")
        Description

        Backend type.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Set to true or false to disable this ACL provider

      • collection

        TypeString
        Description

        MongoDB collection containing the authorization data.

      • filter

        TypeMap
        Default{}
        Description

        Conditional expression that defines the filter condition in the query. Filter supports the following placeholders

        • ${username}: Will be replaced at runtime with Username used by the client when connecting
        • ${clientid}: Will be replaced at runtime with Client ID used by the client when connecting
      • mongo_type

        TypeString("single")
        Defaultsingle
        Description

        Standalone instance. Must be set to 'single' when MongoDB server is running in standalone mode.

      • server

        TypeString
        Description

        The IPv4 or IPv6 address or the hostname to connect to.
        A host entry has the following form: Host[:Port].
        The MongoDB default port 27017 is used if [:Port] is not specified.

      • w_mode

        TypeEnum(unsafe,safe)
        Defaultunsafe
        Description

        Write mode.

      • srv_record

        TypeBoolean
        Defaultfalse
        Description

        Use DNS SRV record.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        Size of the connection pool towards the bridge target service.

      • username

        TypeString
        Description

        The username associated with the bridge in the external database used for authentication or identification purposes.

      • password

        TypeSecret
        Description

        The password associated with the bridge, used for authentication with the external database.
        A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

      • use_legacy_protocol

        TypeEnum(auto,true,false)
        Defaultauto
        Description

        Whether to use MongoDB's legacy protocol for communicating with the database. The default is to attempt to automatically determine if the newer protocol is supported.

      • auth_source

        TypeString
        Description

        Database name associated with the user's credentials.

      • database

        TypeString
        Description

        Database name.

      • topology

        TypeStruct(topology)

        topology

        • max_overflow
          TypeInteger(0..+inf)
          Default0
          Description

          The maximum number of additional workers that can be created when all workers in the pool are busy. This helps to manage temporary spikes in workload by allowing more concurrent connections to the MongoDB server.

        • overflow_ttl
          TypeDuration
          Description

          Period of time before workers that exceed the configured pool size ("overflow") to be terminated.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • overflow_check_period
          TypeDuration
          Description

          Period for checking if there are more workers than configured ("overflow").
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • local_threshold_ms
          TypeDuration
          Description

          The size of the latency window for selecting among multiple suitable MongoDB instances.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • connect_timeout_ms
          TypeDuration
          Description

          The duration to attempt a connection before timing out.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • socket_timeout_ms
          TypeDuration
          Description

          The duration to attempt to send or to receive on a socket before the attempt times out.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • server_selection_timeout_ms
          TypeDuration
          Description

          Specifies how long to block for server selection before throwing an exception.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • wait_queue_timeout_ms
          TypeDuration
          Description

          The maximum duration that a worker can wait for a connection to become available.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • heartbeat_frequency_ms
          TypeDuration
          Default"200s"
          Description

          Controls when the driver checks the state of the MongoDB deployment. Specify the interval between checks, counted from the end of the previous check until the beginning of the next one. If the number of connections is increased (which will happen, for example, if you increase the pool size), you may need to increase this period as well to avoid creating too many log entries in the MongoDB log file.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • min_heartbeat_frequency_ms
          TypeDuration
          Description

          Controls the minimum amount of time to wait between heartbeats.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • ssl

        TypeStruct(ssl_client_opts)
        Default{enable = false}
        Description

        SSL connection settings.

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

      mongo_rs

      • type

        TypeString("mongodb")
        Description

        Backend type.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Set to true or false to disable this ACL provider

      • collection

        TypeString
        Description

        MongoDB collection containing the authorization data.

      • filter

        TypeMap
        Default{}
        Description

        Conditional expression that defines the filter condition in the query. Filter supports the following placeholders

        • ${username}: Will be replaced at runtime with Username used by the client when connecting
        • ${clientid}: Will be replaced at runtime with Client ID used by the client when connecting
      • mongo_type

        TypeString("rs")
        Defaultrs
        Description

        Replica set. Must be set to 'rs' when MongoDB server is running in 'replica set' mode.

      • servers

        TypeString
        Description

        A Node list for Cluster to connect to. The nodes should be separated with commas, such as: Node[,Node]. For each Node should be: The IPv4 or IPv6 address or the hostname to connect to. A host entry has the following form: Host[:Port]. The MongoDB default port 27017 is used if [:Port] is not specified.

      • w_mode

        TypeEnum(unsafe,safe)
        Defaultunsafe
        Description

        Write mode.

      • r_mode

        TypeEnum(master,slave_ok)
        Defaultmaster
        Description

        Read mode.

      • replica_set_name

        TypeString
        Description

        Name of the replica set.

      • srv_record

        TypeBoolean
        Defaultfalse
        Description

        Use DNS SRV record.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        Size of the connection pool towards the bridge target service.

      • username

        TypeString
        Description

        The username associated with the bridge in the external database used for authentication or identification purposes.

      • password

        TypeSecret
        Description

        The password associated with the bridge, used for authentication with the external database.
        A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

      • use_legacy_protocol

        TypeEnum(auto,true,false)
        Defaultauto
        Description

        Whether to use MongoDB's legacy protocol for communicating with the database. The default is to attempt to automatically determine if the newer protocol is supported.

      • auth_source

        TypeString
        Description

        Database name associated with the user's credentials.

      • database

        TypeString
        Description

        Database name.

      • topology

        TypeStruct(topology)

        topology

        • max_overflow
          TypeInteger(0..+inf)
          Default0
          Description

          The maximum number of additional workers that can be created when all workers in the pool are busy. This helps to manage temporary spikes in workload by allowing more concurrent connections to the MongoDB server.

        • overflow_ttl
          TypeDuration
          Description

          Period of time before workers that exceed the configured pool size ("overflow") to be terminated.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • overflow_check_period
          TypeDuration
          Description

          Period for checking if there are more workers than configured ("overflow").
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • local_threshold_ms
          TypeDuration
          Description

          The size of the latency window for selecting among multiple suitable MongoDB instances.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • connect_timeout_ms
          TypeDuration
          Description

          The duration to attempt a connection before timing out.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • socket_timeout_ms
          TypeDuration
          Description

          The duration to attempt to send or to receive on a socket before the attempt times out.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • server_selection_timeout_ms
          TypeDuration
          Description

          Specifies how long to block for server selection before throwing an exception.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • wait_queue_timeout_ms
          TypeDuration
          Description

          The maximum duration that a worker can wait for a connection to become available.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • heartbeat_frequency_ms
          TypeDuration
          Default"200s"
          Description

          Controls when the driver checks the state of the MongoDB deployment. Specify the interval between checks, counted from the end of the previous check until the beginning of the next one. If the number of connections is increased (which will happen, for example, if you increase the pool size), you may need to increase this period as well to avoid creating too many log entries in the MongoDB log file.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • min_heartbeat_frequency_ms
          TypeDuration
          Description

          Controls the minimum amount of time to wait between heartbeats.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • ssl

        TypeStruct(ssl_client_opts)
        Default{enable = false}
        Description

        SSL connection settings.

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

      mongo_sharded

      • type

        TypeString("mongodb")
        Description

        Backend type.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Set to true or false to disable this ACL provider

      • collection

        TypeString
        Description

        MongoDB collection containing the authorization data.

      • filter

        TypeMap
        Default{}
        Description

        Conditional expression that defines the filter condition in the query. Filter supports the following placeholders

        • ${username}: Will be replaced at runtime with Username used by the client when connecting
        • ${clientid}: Will be replaced at runtime with Client ID used by the client when connecting
      • mongo_type

        TypeString("sharded")
        Defaultsharded
        Description

        Sharded cluster. Must be set to 'sharded' when MongoDB server is running in 'sharded' mode.

      • servers

        TypeString
        Description

        A Node list for Cluster to connect to. The nodes should be separated with commas, such as: Node[,Node]. For each Node should be: The IPv4 or IPv6 address or the hostname to connect to. A host entry has the following form: Host[:Port]. The MongoDB default port 27017 is used if [:Port] is not specified.

      • w_mode

        TypeEnum(unsafe,safe)
        Defaultunsafe
        Description

        Write mode.

      • srv_record

        TypeBoolean
        Defaultfalse
        Description

        Use DNS SRV record.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        Size of the connection pool towards the bridge target service.

      • username

        TypeString
        Description

        The username associated with the bridge in the external database used for authentication or identification purposes.

      • password

        TypeSecret
        Description

        The password associated with the bridge, used for authentication with the external database.
        A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

      • use_legacy_protocol

        TypeEnum(auto,true,false)
        Defaultauto
        Description

        Whether to use MongoDB's legacy protocol for communicating with the database. The default is to attempt to automatically determine if the newer protocol is supported.

      • auth_source

        TypeString
        Description

        Database name associated with the user's credentials.

      • database

        TypeString
        Description

        Database name.

      • topology

        TypeStruct(topology)

        topology

        • max_overflow
          TypeInteger(0..+inf)
          Default0
          Description

          The maximum number of additional workers that can be created when all workers in the pool are busy. This helps to manage temporary spikes in workload by allowing more concurrent connections to the MongoDB server.

        • overflow_ttl
          TypeDuration
          Description

          Period of time before workers that exceed the configured pool size ("overflow") to be terminated.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • overflow_check_period
          TypeDuration
          Description

          Period for checking if there are more workers than configured ("overflow").
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • local_threshold_ms
          TypeDuration
          Description

          The size of the latency window for selecting among multiple suitable MongoDB instances.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • connect_timeout_ms
          TypeDuration
          Description

          The duration to attempt a connection before timing out.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • socket_timeout_ms
          TypeDuration
          Description

          The duration to attempt to send or to receive on a socket before the attempt times out.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • server_selection_timeout_ms
          TypeDuration
          Description

          Specifies how long to block for server selection before throwing an exception.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • wait_queue_timeout_ms
          TypeDuration
          Description

          The maximum duration that a worker can wait for a connection to become available.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • heartbeat_frequency_ms
          TypeDuration
          Default"200s"
          Description

          Controls when the driver checks the state of the MongoDB deployment. Specify the interval between checks, counted from the end of the previous check until the beginning of the next one. If the number of connections is increased (which will happen, for example, if you increase the pool size), you may need to increase this period as well to avoid creating too many log entries in the MongoDB log file.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • min_heartbeat_frequency_ms
          TypeDuration
          Description

          Controls the minimum amount of time to wait between heartbeats.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • ssl

        TypeStruct(ssl_client_opts)
        Default{enable = false}
        Description

        SSL connection settings.

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

      ldap

      • type

        TypeString("ldap")
        Description

        Backend type.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Set to true or false to disable this ACL provider

      • publish_attribute

        TypeString
        DefaultmqttPublishTopic
        Description

        Indicates which attribute is used to represent the allowed topics list of the publish.

      • subscribe_attribute

        TypeString
        DefaultmqttSubscriptionTopic
        Description

        Indicates which attribute is used to represent the allowed topics list of the subscribe.

      • all_attribute

        TypeString
        DefaultmqttPubSubTopic
        Description

        Indicates which attribute is used to represent the both allowed topics list of publish and subscribe.

      • query_timeout

        TypeDuration
        Default"5s"
        Description

        Timeout for the LDAP query.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • server

        TypeString
        Description

        The IPv4 or IPv6 address or the hostname to connect to.
        A host entry has the following form: Host[:Port].
        The LDAP default port 389 is used if [:Port] is not specified.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        Size of the connection pool towards the bridge target service.

      • username

        TypeString
        Description

        The username associated with the bridge in the external database used for authentication or identification purposes.

      • password

        TypeSecret
        Description

        The password associated with the bridge, used for authentication with the external database.
        A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

      • base_dn

        TypeString
        Description

        The name of the base object entry (or possibly the root) relative to which the Search is to be performed.

      • filter

        TypeString
        Default"(objectClass=mqttUser)"
        Description

        The filter that defines the conditions that must be fulfilled in order for the Search to match a given entry.
        The syntax of the filter follows RFC 4515 and also supports placeholders.

      • request_timeout

        TypeDuration
        Default"10s"
        Description

        Sets the maximum time in milliseconds that is used for each individual request.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • ssl

        TypeStruct(ssl)
        Default{enable = false}
        Description

        SSL connection settings.

        ssl

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

  • node

    TypeStruct(node)

    node

    • name

      TypeString
      Default"emqx@127.0.0.1"
      Description

      Unique name of the EMQX node. It must follow %name%@FQDN or %name%@IPv4 format.

    • TypeString
      Description

      Secret cookie is a random string that should be the same on all nodes in the given EMQX cluster, but unique per EMQX cluster. It is used to prevent EMQX nodes that belong to different clusters from accidentally connecting to each other.

    • max_ports

      TypeInteger(1024..134217727)
      Default1048576
      Description

      Maximum number of simultaneously open files and sockets for this Erlang system. For more information, see: https://www.erlang.org/doc/man/erl.html

    • dist_buffer_size

      TypeInteger(1..2097151)
      Default8192
      Description

      Erlang's distribution buffer busy limit in kilobytes.

    • data_dir

      TypeString
      Description

      Path to the persistent data directory.
      Possible auto-created subdirectories are:

      • mnesia/<node_name>: EMQX's built-in database directory.
        For example, mnesia/emqx@127.0.0.1.
        There should be only one such subdirectory.
        Meaning, in case the node is to be renamed (to e.g. emqx@10.0.1.1),
        the old dir should be deleted first.
      • configs: Generated configs at boot time, and cluster/local override configs.
      • patches: Hot-patch beam files are to be placed here.
      • trace: Trace log files.

      NOTE: One data dir cannot be shared by two or more EMQX nodes.

    • global_gc_interval

      TypeOneOf(String("disabled"),Duration)
      Default"15m"
      Description

      Periodic garbage collection interval. Set to disabled to have it disabled.

    • role

      Aliasesdb_role
      TypeEnum(core,replicant)
      Defaultcore
      Description

      Select a node role.
      core nodes provide durability of the data, and take care of writes. It is recommended to place core nodes in different racks or different availability zones.
      replicant nodes are ephemeral worker nodes. Removing them from the cluster doesn't affect database redundancy
      It is recommended to have more replicant nodes than core nodes.
      Note: this parameter only takes effect when the backend is set to rlog.

  • cluster

    TypeStruct(cluster)

    cluster

    • name

      TypeString
      Defaultemqxcl
      Description

      Human-friendly name of the EMQX cluster.

    • discovery_strategy

      TypeEnum(manual,static,dns,etcd,k8s)
      Defaultmanual
      Description

      Service discovery method for the cluster nodes. Possible values are:

      • manual: Use emqx ctl cluster command to manage cluster.
      • static: Configure static nodes list by setting seeds in config file.
      • dns: Use DNS A record to discover peer nodes.
      • etcd: Use etcd to discover peer nodes.
      • k8s: Use Kubernetes API to discover peer pods.
    • autoclean

      TypeDuration
      Default"24h"
      Description

      Remove disconnected nodes from the cluster after this interval.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • autoheal

      TypeBoolean
      Defaulttrue
      Description

      If true, the node will try to heal network partitions automatically.

    • proto_dist

      TypeEnum(inet_tcp,inet6_tcp,inet_tls,inet6_tls)
      Defaultinet_tcp
      Description

      The Erlang distribution protocol for the cluster.

      • inet_tcp: IPv4 TCP
      • inet_tls: IPv4 TLS, works together with etc/ssl_dist.conf
      • inet6_tcp: IPv6 TCP
      • inet6_tls: IPv6 TLS, works together with etc/ssl_dist.conf
    • static

      TypeStruct(cluster_static)

      cluster_static

      • seeds

        TypeOneOf(String,Array(String))
        Default[]
        Description

        List EMQX node names in the static cluster. See node.name.

    • dns

      TypeStruct(cluster_dns)

      cluster_dns

      • name

        TypeString
        Defaultlocalhost
        Description

        The domain name from which to discover peer EMQX nodes' IP addresses. Applicable when cluster.discovery_strategy = dns

      • record_type

        TypeEnum(a,aaaa,srv)
        Defaulta
        Description

        DNS record type.

    • etcd

      TypeStruct(cluster_etcd)

      cluster_etcd

      • server

        TypeString
        Description

        List of endpoint URLs of the etcd cluster

      • prefix

        TypeString
        Defaultemqxcl
        Description

        Key prefix used for EMQX service discovery.

      • node_ttl

        TypeDuration
        Default"1m"
        Description

        Expiration time of the etcd key associated with the node. It is refreshed automatically, as long as the node is alive.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • ssl_options

        Aliasesssl
        TypeStruct(ssl_client_opts)
        Description

        Options for the TLS connection to the etcd cluster.

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    • k8s

      TypeStruct(cluster_k8s)

      cluster_k8s

      • apiserver

        TypeString
        Default"https://kubernetes.default.svc:443"
        Description

        Kubernetes API endpoint URL.

      • service_name

        TypeString
        Defaultemqx
        Description

        EMQX broker service name.

      • address_type

        TypeEnum(ip,dns,hostname)
        Defaultip
        Description

        Address type used for connecting to the discovered nodes. Setting cluster.k8s.address_type to ip will make EMQX to discover IP addresses of peer nodes from Kubernetes API.

      • namespace

        TypeString
        Defaultdefault
        Description

        Kubernetes namespace.

      • suffix

        TypeString
        Default"pod.local"
        Description

        Node name suffix.
        Note: this parameter is only relevant when address_type is dns or hostname.

  • log

    TypeStruct(log)
    Description

    EMQX provides support for two primary log handlers: file and console, with an additional audit handler specifically designed to always direct logs to files. The system's default log handling behavior can be configured via the environment variable EMQX_DEFAULT_LOG_HANDLER, which accepts the following settings:

    • file: Directs log output exclusively to files.
    • console: Channels log output solely to the console.

    It's noteworthy that EMQX_DEFAULT_LOG_HANDLER is set to file when EMQX is initiated via systemd's emqx.service file. In scenarios outside systemd initiation, console serves as the default log handler.

    log

    • console

      Aliasesconsole_handler
      TypeStruct(console_handler)

      console_handler

      • level

        TypeEnum(debug,info,notice,warning,error,critical,alert,emergency,all)
        Defaultwarning
        Description

        The log level for the current log handler. Defaults to warning.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable this log handler.

      • formatter

        Aliasesformat
        TypeEnum(text,json)
        Defaulttext
        Description

        Choose log formatter. text for free text, and json for structured logging.

      • timestamp_format

        TypeEnum(auto,epoch,rfc3339)
        Defaultauto
        Description

        Pick a timestamp format:

        • auto: automatically choose the best format based on log formatter. epoch for JSON and rfc3339 for text.
        • epoch: Unix epoch time in microseconds.
        • rfc3339: RFC3339 format.
      • time_offset

        TypeString
        Defaultsystem
        Description

        The time offset to be used when formatting the timestamp. Can be one of:

        • system: the time offset used by the local system
        • utc: the UTC time offset
        • +-[hh]:[mm]: user specified time offset, such as "-02:00" or "+00:00" Defaults to: system. This config has no effect for when formatter is json as the timestamp in JSON is milliseconds since epoch.
    • file

      Aliasesfile_handlers
      TypeOneOf(Struct(log_file_handler),Map($handler_name->Struct(log_file_handler)))
      Default{level = warning}
      Description

      File-based log handlers.

      log_file_handler

      • path

        Aliasesfile, to
        TypeString
        Default"${EMQX_LOG_DIR}/emqx.log"
        Description

        Name the log file.

      • rotation_count

        Aliasesrotation
        TypeInteger(1..128)
        Default10
        Description

        Maximum number of log files.

      • rotation_size

        Aliasesmax_size
        TypeOneOf(String("infinity"),Bytesize)
        Default"50MB"
        Description

        This parameter controls log file rotation. The value infinity means the log file will grow indefinitely, otherwise the log file will be rotated once it reaches rotation_size in bytes.

      • level

        TypeEnum(debug,info,notice,warning,error,critical,alert,emergency,all)
        Defaultwarning
        Description

        The log level for the current log handler. Defaults to warning.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Enable this log handler.

      • formatter

        Aliasesformat
        TypeEnum(text,json)
        Defaulttext
        Description

        Choose log formatter. text for free text, and json for structured logging.

      • timestamp_format

        TypeEnum(auto,epoch,rfc3339)
        Defaultauto
        Description

        Pick a timestamp format:

        • auto: automatically choose the best format based on log formatter. epoch for JSON and rfc3339 for text.
        • epoch: Unix epoch time in microseconds.
        • rfc3339: RFC3339 format.
      • time_offset

        TypeString
        Defaultsystem
        Description

        The time offset to be used when formatting the timestamp. Can be one of:

        • system: the time offset used by the local system
        • utc: the UTC time offset
        • +-[hh]:[mm]: user specified time offset, such as "-02:00" or "+00:00" Defaults to: system. This config has no effect for when formatter is json as the timestamp in JSON is milliseconds since epoch.

      log_file_handler

      • path

        Aliasesfile, to
        TypeString
        Default"${EMQX_LOG_DIR}/emqx.log"
        Description

        Name the log file.

      • rotation_count

        Aliasesrotation
        TypeInteger(1..128)
        Default10
        Description

        Maximum number of log files.

      • rotation_size

        Aliasesmax_size
        TypeOneOf(String("infinity"),Bytesize)
        Default"50MB"
        Description

        This parameter controls log file rotation. The value infinity means the log file will grow indefinitely, otherwise the log file will be rotated once it reaches rotation_size in bytes.

      • level

        TypeEnum(debug,info,notice,warning,error,critical,alert,emergency,all)
        Defaultwarning
        Description

        The log level for the current log handler. Defaults to warning.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Enable this log handler.

      • formatter

        Aliasesformat
        TypeEnum(text,json)
        Defaulttext
        Description

        Choose log formatter. text for free text, and json for structured logging.

      • timestamp_format

        TypeEnum(auto,epoch,rfc3339)
        Defaultauto
        Description

        Pick a timestamp format:

        • auto: automatically choose the best format based on log formatter. epoch for JSON and rfc3339 for text.
        • epoch: Unix epoch time in microseconds.
        • rfc3339: RFC3339 format.
      • time_offset

        TypeString
        Defaultsystem
        Description

        The time offset to be used when formatting the timestamp. Can be one of:

        • system: the time offset used by the local system
        • utc: the UTC time offset
        • +-[hh]:[mm]: user specified time offset, such as "-02:00" or "+00:00" Defaults to: system. This config has no effect for when formatter is json as the timestamp in JSON is milliseconds since epoch.
    • throttling

      TypeStruct(log_throttling)

      log_throttling

      • time_window

        TypeDuration(s)
        Default"1m"
        Description

        This configuration setting controls the logging behavior for throttled messages, including, but not limited to messages like 'authorization_permission_denied'. Within each defined time window, only one instance of a throttled message will be logged to prevent log flooding. At the conclusion of each time window, a summary log will be generated, detailing the occurrence of any throttled messages during that period. It's important to note that the shortest effective time window for this setting is 1 second (1s). Should a value lower than 1s be specified, it will automatically be adjusted to 1s.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

  • rpc

    TypeStruct(rpc)

    rpc

    • mode

      TypeEnum(sync,async)
      Defaultasync
      Description

      In sync mode the sending side waits for the ack from the receiving side.

    • protocol

      Aliasesdriver
      TypeEnum(tcp,ssl)
      Defaulttcp
      Description

      Transport protocol used for inter-broker communication

    • async_batch_size

      TypeInteger
      Default256
      Description

      The maximum number of batch messages sent in asynchronous mode. Note that this configuration does not work in synchronous mode.

    • port_discovery

      TypeEnum(manual,stateless)
      Defaultstateless
      Description

      manual: discover ports by tcp_server_port.
      stateless: discover ports in a stateless manner, using the following algorithm. If node name is emqxN@127.0.0.1, where the N is an integer, then the listening port will be 5370 + N.

    • tcp_server_port

      TypeInteger
      Default5369
      Description

      Listening port used by RPC local service.
      Note that this config only takes effect when rpc.port_discovery is set to manual.

    • ssl_server_port

      TypeInteger
      Default5369
      Description

      Listening port used by RPC local service.
      Note that this config only takes effect when rpc.port_discovery is set to manual and driver is set to ssl.

    • tcp_client_num

      TypeInteger(1..256)
      Default10
      Description

      Set the maximum number of RPC communication channels initiated by this node to each remote node.

    • connect_timeout

      TypeDuration
      Default"5s"
      Description

      Timeout for establishing an RPC connection.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • certfile

      TypeString
      Description

      Path to TLS certificate file used to validate identity of the cluster nodes. Note that this config only takes effect when rpc.driver is set to ssl.

    • keyfile

      TypeString
      Description

      Path to the private key file for the rpc.certfile.
      Note: contents of this file are secret, so it's necessary to set permissions to 600.

    • cacertfile

      TypeString
      Description

      Path to certification authority TLS certificate file used to validate rpc.certfile.
      Note: certificates of all nodes in the cluster must be signed by the same CA.

    • send_timeout

      TypeDuration
      Default"5s"
      Description

      Timeout for sending the RPC request.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • authentication_timeout

      TypeDuration
      Default"5s"
      Description

      Timeout for the remote node authentication.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • call_receive_timeout

      TypeDuration
      Default"15s"
      Description

      Timeout for the reply to a synchronous RPC.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • socket_keepalive_idle

      TypeDuration(s)
      Default"15m"
      Description

      How long the connections between the brokers should remain open after the last message is sent.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • socket_keepalive_interval

      TypeDuration(s)
      Default"75s"
      Description

      The interval between keepalive messages.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • socket_keepalive_count

      TypeInteger
      Default9
      Description

      How many times the keepalive probe message can fail to receive a reply until the RPC connection is considered lost.

    • socket_sndbuf

      TypeBytesize
      Default"1MB"
      Description

      TCP tuning parameters. TCP sending buffer size.
      A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

    • socket_recbuf

      TypeBytesize
      Default"1MB"
      Description

      TCP tuning parameters. TCP receiving buffer size.
      A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

    • socket_buffer

      TypeBytesize
      Default"1MB"
      Description

      TCP tuning parameters. Socket buffer size in user mode.
      A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

    • insecure_fallback

      TypeBoolean
      Defaulttrue
      Description

      Enable compatibility with old RPC authentication.

    • ciphers

      TypeArray(String)
      Default[]
      Description

      This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
      Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

      The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

      NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

      NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
      If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
      PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

    • tls_versions

      TypeArray(String)
      Default["tlsv1.3", "tlsv1.2"]
      Description

      All TLS/DTLS versions to be supported.
      NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
      In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

    • listen_address

      TypeString
      Default"0.0.0.0"
      Description

      Indicates the IP address for the RPC server to listen on. For example, use "0.0.0.0" for IPv4 or "::" for IPv6.

    • ipv6_only

      TypeBoolean
      Defaultfalse
      Description

      This setting is effective only when rpc.listen_address is assigned an IPv6 address. If set to true, the RPC client will exclusively use IPv6 for connections. Otherwise, the client might opt for IPv4, even if the server is on IPv6.

  • sys_topics

    TypeStruct(sys_topics)
    Description

    System topics configuration.

    sys_topics

    • sys_msg_interval

      TypeOneOf(String("disabled"),Duration)
      Default"1m"
      Description

      Time interval for publishing following system messages:

      • $SYS/brokers
      • $SYS/brokers/<node>/version
      • $SYS/brokers/<node>/sysdescr
      • $SYS/brokers/<node>/stats/<name>
      • $SYS/brokers/<node>/metrics/<name>
    • sys_heartbeat_interval

      TypeOneOf(String("disabled"),Duration)
      Default"30s"
      Description

      Time interval for publishing following heartbeat messages:

      • $SYS/brokers/<node>/uptime
      • $SYS/brokers/<node>/datetime
    • sys_event_messages

      TypeStruct(event_names)
      Description

      Client events messages.

      event_names

      • client_connected

        TypeBoolean
        Defaulttrue
        Description

        Enable to publish client connected event messages

      • client_disconnected

        TypeBoolean
        Defaulttrue
        Description

        Enable to publish client disconnected event messages.

      • client_subscribed

        TypeBoolean
        Defaultfalse
        Description

        Enable to publish event message that client subscribed a topic successfully.

      • client_unsubscribed

        TypeBoolean
        Defaultfalse
        Description

        Enable to publish event message that client unsubscribed a topic successfully.

  • force_shutdown

    TypeStruct(force_shutdown)

    force_shutdown

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Enable force_shutdown feature.

    • max_mailbox_size

      Aliasesmax_message_queue_len
      TypeInteger(0..inf)
      Default1000
      Description

      In EMQX, each online client corresponds to an individual Erlang process. The configuration value establishes a mailbox size limit for these processes. If the mailbox size surpasses this limit, the client will be automatically terminated.

    • max_heap_size

      TypeBytesize
      Default"32MB"
      Description

      Total heap size
      A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

  • durable_storage

    TypeStruct(durable_storage)
    Description

    Configuration related to the EMQX durable storages.

    EMQX uses durable storages to offload various data, such as MQTT messages, to disc.

    durable_storage

    • messages

      TypeOneOf(Struct(builtin))
      Default{backend = builtin}
      Description

      Configuration related to the durable storage of MQTT messages.

      builtin

      • backend

        TypeString("builtin")
        Defaultbuiltin
        Description

        Built-in backend.

      • data_dir

        TypeString
        Description

        File system directory where the database is located.

        By default, it is equal to node.data_dir.

      • n_shards

        TypeInteger(1..+inf)
        Default12
        Description

        The built-in durable storage partitions data into shards. This configuration parameter defines the number of shards. Please note that it takes effect only during the initialization of the durable storage database. Changing this configuration parameter after the database has been already created won't take any effect.

      • layout

        TypeOneOf(Struct(layout_builtin_wildcard_optimized),Struct(layout_builtin_reference))
        Default{type = wildcard_optimized}
        Description

        Storage layout is a method of arranging messages from various topics and clients on disc.

        Depending on the type of workload and the topic structure, different types of strategies for storing the data can be employed to maximize efficiency of reading messages from the durable storage.

        layout_builtin_wildcard_optimized

        • type
          TypeString("wildcard_optimized")
          Defaultwildcard_optimized
          Description

          Wildcard-optimized layout type.

        layout_builtin_reference

        • type
          TypeString("reference")
          Description

          Reference layout type.

  • force_gc

    TypeStruct(force_gc)

    force_gc

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Enable forced garbage collection.

    • count

      TypeInteger(0..inf)
      Default16000
      Description

      GC the process after this many received messages.

    • bytes

      TypeBytesize
      Default"16MB"
      Description

      GC the process after specified number of bytes have passed through.
      A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

  • sysmon

    TypeStruct(sysmon)

    sysmon

    • vm

      TypeStruct(sysmon_vm)

      sysmon_vm

      • process_check_interval

        TypeDuration
        Default"30s"
        Description

        The time interval for the periodic process limit check.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • process_high_watermark

        TypeString
        Default"80%"
        Description

        The threshold, as percentage of processes, for how many processes can simultaneously exist at the local node before the corresponding alarm is raised.

      • process_low_watermark

        TypeString
        Default"60%"
        Description

        The threshold, as percentage of processes, for how many processes can simultaneously exist at the local node before the corresponding alarm is cleared.

      • long_gc

        TypeOneOf(String("disabled"),Duration)
        Defaultdisabled
        Description

        When an Erlang process spends long time to perform garbage collection, a warning level long_gc log is emitted, and an MQTT message is published to the system topic $SYS/sysmon/long_gc.

      • long_schedule

        TypeOneOf(String("disabled"),Duration)
        Default"240ms"
        Description

        When the Erlang VM detect a task scheduled for too long, a warning level 'long_schedule' log is emitted, and an MQTT message is published to the system topic $SYS/sysmon/long_schedule.

      • large_heap

        TypeOneOf(String("disabled"),Bytesize)
        Default"32MB"
        Description

        When an Erlang process consumed a large amount of memory for its heap space, the system will write a warning level large_heap log, and an MQTT message is published to the system topic $SYS/sysmon/large_heap.

      • busy_dist_port

        TypeBoolean
        Defaulttrue
        Description

        When the RPC connection used to communicate with other nodes in the cluster is overloaded, there will be a busy_dist_port warning log, and an MQTT message is published to system topic $SYS/sysmon/busy_dist_port.

      • busy_port

        TypeBoolean
        Defaulttrue
        Description

        When a port (e.g. TCP socket) is overloaded, there will be a busy_port warning log, and an MQTT message is published to the system topic $SYS/sysmon/busy_port.

    • os

      TypeStruct(sysmon_os)

      sysmon_os

      • cpu_check_interval

        TypeDuration
        Default"60s"
        Description

        The time interval for the periodic CPU check. Disabled on Windows platform.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • cpu_high_watermark

        TypeString
        Default"80%"
        Description

        The threshold, as percentage of system CPU load, for how much system cpu can be used before the corresponding alarm is raised. Disabled on Windows platform

      • cpu_low_watermark

        TypeString
        Default"60%"
        Description

        The threshold, as percentage of system CPU load, for how much system cpu can be used before the corresponding alarm is cleared. Disabled on Windows platform

      • mem_check_interval

        TypeOneOf(String("disabled"),Duration)
        Default"60s"
        Description

        The time interval for the periodic memory check. Disabled on Windows platform.

      • sysmem_high_watermark

        TypeString
        Default"70%"
        Description

        The threshold, as percentage of system memory, for how much system memory can be allocated before the corresponding alarm is raised. Disabled on Windows platform

      • procmem_high_watermark

        TypeString
        Default"5%"
        Description

        The threshold, as percentage of system memory, for how much system memory can be allocated by one Erlang process before the corresponding alarm is raised. Disabled on Windows platform.

  • alarm

    TypeStruct(alarm)

    alarm

    • actions

      TypeArray(Enum(log,publish))
      Default[log, publish]
      Description

      The actions triggered when the alarm is activated.
      Currently, the following actions are supported: log and publish. log is to write the alarm to log (console or file). publish is to publish the alarm as an MQTT message to the system topics: $SYS/brokers/emqx@xx.xx.xx.x/alarms/activate and $SYS/brokers/emqx@xx.xx.xx.x/alarms/deactivate

    • size_limit

      TypeInteger(1..3000)
      Default1000
      Description

      The maximum total number of deactivated alarms to keep as history.
      When this limit is exceeded, the oldest deactivated alarms are deleted to cap the total number.

    • validity_period

      TypeDuration
      Default"24h"
      Description

      Retention time of deactivated alarms. Alarms are not deleted immediately when deactivated, but after the retention time.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

  • flapping_detect

    TypeStruct(flapping_detect)

    flapping_detect

    • enable

      TypeBoolean
      Defaultfalse
      Description

      Enable flapping connection detection feature.

    • window_time

      TypeDuration
      Default"1m"
      Description

      The time window for flapping detection.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • max_count

      TypeInteger(0..+inf)
      Default15
      Description

      The maximum number of disconnects allowed for a MQTT Client in window_time

    • ban_time

      TypeDuration
      Default"5m"
      Description

      How long the flapping clientid will be banned.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

  • connectors

    TypeStruct(connectors)

    connectors

    • http

      TypeMap($name->Struct(config_connector))
      Description

      HTTP Connector Config

      config_connector

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Enable (true) or disable (false) this connector.

      • tags

        TypeArray(String)
        Description

        Tags to annotate this config entry.

      • description

        TypeString
        Default""
        Description

        Descriptive text.

      • url

        TypeString
        Description

        The URL of the HTTP action.
        Template with variables is allowed in the path, but variables cannot be used in the scheme, host, or port part.
        For example, http://localhost:9901/${topic} is allowed, but http://${host}:9901/message or http://localhost:${port}/message is not allowed.

      • headers

        TypeMap
        Default{accept = "application/json", cache-control = "no-cache", connection = "keep-alive", content-type = "application/json", keep-alive = "timeout=5"}
        Description

        The headers of the HTTP request.
        Template with variables is allowed.

      • connect_timeout

        TypeDuration
        Default"15s"
        Description

        The timeout when connecting to the HTTP server.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • retry_interval

        TypeDuration
        Description

        Deprecated since 5.0.4.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • pool_type

        TypeEnum(random,hash)
        Defaultrandom
        Description

        The type of the pool. Can be one of random, hash.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        The pool size.

      • enable_pipelining

        TypeInteger(1..+inf)
        Default100
        Description

        A positive integer. Whether to send HTTP requests continuously, when set to 1, it means that after each HTTP request is sent, you need to wait for the server to return and then continue to send the next request.

      • request

        TypeMap
        Description

        Deprecated since 5.3.2.

      • ssl

        TypeStruct(ssl_client_opts)
        Default{enable = false}
        Description

        SSL connection settings.

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

      • resource_opts

        TypeStruct(connector_resource_opts)
        Default{}
        Description

        Resource options.

        connector_resource_opts

        • health_check_interval
          TypeDuration
          Default"15s"
          Description

          Health check interval.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • start_after_created
          TypeBoolean
          Defaulttrue
          Description

          Whether start the resource right after created.

        • start_timeout
          TypeDuration
          Default"5s"
          Description

          Time interval to wait for an auto-started resource to become healthy before responding resource creation requests.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • mqtt

      TypeMap($name->Struct(config_connector))
      Description

      MQTT Connector Config

      config_connector

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Enable (true) or disable (false) this connector.

      • tags

        TypeArray(String)
        Description

        Tags to annotate this config entry.

      • description

        TypeString
        Default""
        Description

        Descriptive text.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        Size of the pool of MQTT clients that will publish messages to the remote broker.
        Each MQTT client will be assigned 'clientid' of the form '${clientid_prefix}:${bridge_name}:egress:${node}:${n}' where 'n' is the number of a client inside the pool.

      • resource_opts

        TypeStruct(resource_opts)
        Default{}
        Description

        Resource options.

        resource_opts

        • health_check_interval
          TypeDuration
          Default"15s"
          Description

          Health check interval.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • start_after_created
          TypeBoolean
          Defaulttrue
          Description

          Whether start the resource right after created.

        • start_timeout
          TypeDuration
          Default"5s"
          Description

          Time interval to wait for an auto-started resource to become healthy before responding resource creation requests.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • mode

        TypeEnum(cluster_shareload)
        Description

        Deprecated since v5.1.0 & e5.1.0.

      • server

        TypeString
        Description

        The host and port of the remote MQTT broker

      • clientid_prefix

        TypeString
        Description

        Optional prefix to prepend to the clientid used by egress bridges.

      • reconnect_interval

        TypeString
        Description

        Deprecated since v5.0.16.

      • proto_ver

        TypeEnum(v3,v4,v5)
        Defaultv4
        Description

        The MQTT protocol version

      • bridge_mode

        TypeBoolean
        Defaultfalse
        Description

        If enable bridge mode. NOTE: This setting is only for MQTT protocol version older than 5.0, and the remote MQTT broker MUST support this feature. If bridge_mode is set to true, the bridge will indicate to the remote broker that it is a bridge not an ordinary client. This means that loop detection will be more effective and that retained messages will be propagated correctly.

      • username

        TypeString
        Description

        The username of the MQTT protocol

      • password

        TypeSecret
        Description

        The password of the MQTT protocol
        A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

      • clean_start

        TypeBoolean
        Defaulttrue
        Description

        Whether to start a clean session when reconnecting a remote broker for ingress bridge

      • keepalive

        TypeString
        Default"300s"
        Description

        MQTT Keepalive. Time interval is a string that contains a number followed by time unit:
        - ms for milliseconds,

        • s for seconds,
        • m for minutes,
        • h for hours;
          or combination of whereof: 1h5m0s
      • retry_interval

        TypeString
        Default"15s"
        Description

        Message retry interval. Delay for the MQTT bridge to retry sending the QoS1/QoS2 messages in case of ACK not received. Time interval is a string that contains a number followed by time unit:
        - ms for milliseconds,

        • s for seconds,
        • m for minutes,
        • h for hours;
          or combination of whereof: 1h5m0s
      • max_inflight

        TypeInteger(0..+inf)
        Default32
        Description

        Max inflight (sent, but un-acked) messages of the MQTT protocol

      • ssl

        TypeStruct(ssl_client_opts)
        Default{enable = false}
        Description

        SSL connection settings.

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

    • elasticsearch

      TypeMap($name->Struct(config))
      Description

      ElasticSearch Connector Config

      config

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Enable (true) or disable (false) this connector.

      • tags

        TypeArray(String)
        Description

        Tags to annotate this config entry.

      • description

        TypeString
        Default""
        Description

        Descriptive text.

      • connect_timeout

        TypeDuration
        Default"15s"
        Description

        The timeout when connecting to the HTTP server.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • pool_type

        TypeEnum(random,hash)
        Defaultrandom
        Description

        The type of the pool. Can be one of random, hash.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        The pool size.

      • enable_pipelining

        TypeInteger(1..+inf)
        Default100
        Description

        A positive integer. Whether to send HTTP requests continuously, when set to 1, it means that after each HTTP request is sent, you need to wait for the server to return and then continue to send the next request.

      • ssl

        TypeStruct(ssl_client_opts)
        Default{enable = false}
        Description

        SSL connection settings.

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

      • resource_opts

        TypeStruct(connector_resource_opts)
        Default{}
        Description

        Resource options.

        connector_resource_opts

        • health_check_interval
          TypeDuration
          Default"15s"
          Description

          Health check interval.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • start_after_created
          TypeBoolean
          Defaulttrue
          Description

          Whether start the resource right after created.

        • start_timeout
          TypeDuration
          Default"5s"
          Description

          Time interval to wait for an auto-started resource to become healthy before responding resource creation requests.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • server

        TypeString
        Default"127.0.0.1:9200"
        Description

        The IPv4 or IPv6 address or the hostname to connect to. A host entry has the following form: Host[:Port]. The Elasticsearch default port 9200 is used if [:Port] is not specified.

      • authentication

        TypeOneOf(Struct(auth_basic))
        Description

        Authentication configuration

        auth_basic

        • username
          TypeString
          Description

          The username as configured at the ElasticSearch REST interface

        • password
          TypeSecret
          Description

          The password as configured at the ElasticSearch REST interface
          A string holding some sensitive information, such as a password. When secret starts with file://, the rest of the string is interpreted as a path to a file containing the secret itself: whole content of the file except any trailing whitespace characters is considered a secret value. Note: when clustered, all EMQX nodes should have the same file present before using file:// secrets.

  • actions

    TypeStruct(actions)

    actions

    • http

      Aliaseswebhook
      TypeMap($name->Struct(http_action))
      Description

      HTTP Action Config

      http_action

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Enable or disable this action.

      • connector

        TypeString
        Description

        Name of the connector specified by the action, used for external resource selection.

      • tags

        TypeArray(String)
        Description

        Tags to annotate this config entry.

      • description

        TypeString
        Default""
        Description

        Descriptive text.

      • parameters

        TypeStruct(parameters_opts)
        Description

        The parameters for HTTP action.

        parameters_opts

        • path
          TypeString
          Description

          The URL path for this Action.
          This path will be appended to the Connector's url configuration to form the full URL address. Template with variables is allowed in this option. For example, /room/{$room_no}
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • method
          TypeEnum(post,put,get,delete)
          Defaultpost
          Description

          The method of the HTTP request. All the available methods are: post, put, get, delete.
          Template with variables is allowed.

        • headers
          TypeMap
          Default{accept = "application/json", cache-control = "no-cache", connection = "keep-alive", content-type = "application/json", keep-alive = "timeout=5"}
          Description

          The headers of the HTTP request.
          Template with variables is allowed.

        • body
          TypeString
          Description

          The body of the HTTP request.
          If not provided, the body will be a JSON object of all the available fields.
          There, 'all the available fields' means the context of a MQTT message when this webhook is triggered by receiving a MQTT message (the local_topic is set), or the context of the event when this webhook is triggered by a rule (i.e. this webhook is used as an action of a rule).
          Template with variables is allowed.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • max_retries
          TypeInteger(0..+inf)
          Default2
          Description

          HTTP request max retry times if failed.

        • request_timeout
          TypeDuration
          Description

          Deprecated since v5.0.26.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • resource_opts

        TypeStruct(action_resource_opts)
        Default{}
        Description

        Resource options.

        action_resource_opts

        • worker_pool_size
          TypeInteger(1..1024)
          Default16
          Description

          The number of buffer workers. Only applicable for egress type bridges. For bridges only have ingress direction data flow, it can be set to 0 otherwise must be greater than 0.

        • health_check_interval
          TypeDuration
          Default"15s"
          Description

          Health check interval.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • query_mode
          TypeEnum(sync,async)
          Defaultasync
          Description

          Query mode. Optional 'sync/async', default 'async'.

        • request_ttl
          Aliasesrequest_timeout
          TypeOneOf(Duration,String("infinity"))
          Default"45s"
          Description

          Starting from the moment when the request enters the buffer, if the request remains in the buffer for the specified time or is sent but does not receive a response or acknowledgement in time, the request is considered expired.

        • inflight_window
          Aliasesasync_inflight_window
          TypeInteger(1..+inf)
          Default100
          Description

          Query inflight window. When query_mode is set to async, this config has to be set to 1 if messages from the same MQTT client have to be strictly ordered.

        • max_buffer_bytes
          Aliasesmax_queue_bytes
          TypeBytesize
          Default"256MB"
          Description

          Maximum number of bytes to buffer for each buffer worker.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

    • mqtt

      TypeMap($name->Struct(mqtt_publisher_action))
      Description

      MQTT Publisher Action Config

      mqtt_publisher_action

      • local_topic

        TypeString
        Description

        MQTT topic or topic filter as data source (action input). If rule action is used as data source, this config should be left empty, otherwise messages will be duplicated in the remote system.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Enable (true) or disable (false) this action.

      • connector

        TypeString
        Description

        Name of the connector specified by the action, used for external resource selection.

      • tags

        TypeArray(String)
        Description

        Tags to annotate this config entry.

      • description

        TypeString
        Default""
        Description

        Descriptive text.

      • parameters

        TypeStruct(action_parameters)
        Description

        Action specific configs.

        action_parameters

        • topic
          TypeString
          Description

          Forward to which topic of the remote broker.
          Template with variables is allowed.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • qos
          TypeOneOf(Integer(0..2),String)
          Default1
          Description

          The QoS of the MQTT message to be sent.
          Template with variables is allowed.

        • retain
          TypeOneOf(Boolean,String)
          Defaultfalse
          Description

          The 'retain' flag of the MQTT message to be sent.
          Template with variables is allowed.

        • payload
          TypeString
          Description

          The payload of the MQTT message to be sent.
          Template with variables is allowed.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

      • resource_opts

        TypeStruct(action_resource_opts)
        Default{}
        Description

        Resource options.

        action_resource_opts

        • worker_pool_size
          TypeInteger(1..1024)
          Default16
          Description

          The number of buffer workers. Only applicable for egress type bridges. For bridges only have ingress direction data flow, it can be set to 0 otherwise must be greater than 0.

        • health_check_interval
          TypeDuration
          Default"15s"
          Description

          Health check interval.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • query_mode
          TypeEnum(sync,async)
          Defaultasync
          Description

          Query mode. Optional 'sync/async', default 'async'.

        • request_ttl
          Aliasesrequest_timeout
          TypeOneOf(Duration,String("infinity"))
          Default"45s"
          Description

          Starting from the moment when the request enters the buffer, if the request remains in the buffer for the specified time or is sent but does not receive a response or acknowledgement in time, the request is considered expired.

        • inflight_window
          Aliasesasync_inflight_window
          TypeInteger(1..+inf)
          Default100
          Description

          Query inflight window. When query_mode is set to async, this config has to be set to 1 if messages from the same MQTT client have to be strictly ordered.

        • max_buffer_bytes
          Aliasesmax_queue_bytes
          TypeBytesize
          Default"256MB"
          Description

          Maximum number of bytes to buffer for each buffer worker.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

    • elasticsearch

      TypeMap($action_name->Struct(action_config))
      Description

      Elasticsearch Bridge

      action_config

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Enable (true) or disable (false) this action.

      • connector

        TypeString
        Description

        Name of the connector specified by the action, used for external resource selection.

      • tags

        TypeArray(String)
        Description

        Tags to annotate this config entry.

      • description

        TypeString
        Default""
        Description

        Descriptive text.

      • parameters

        TypeOneOf(Struct(action_create),Struct(action_delete),Struct(action_update))
        Description

        ElasticSearch action parameters

        action_create

        • action
          TypeString("create")
          Description

          create

        • index
          TypeString
          Description

          Name of index, or index alias to perform the action on. This parameter is required.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • id
          TypeString
          Description

          The document ID. If no ID is specified, a document ID is automatically generated.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • doc
          TypeString
          Description

          JSON document. If undefined, rule engine will use JSON format to serialize all visible inputs, such as clientid, topic, payload etc.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • routing
          TypeString
          Description

          Custom value used to route operations to a specific shard.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • require_alias
          TypeBoolean
          Description

          If true, the request’s actions must target an index alias. Defaults to false

        • overwrite
          TypeBoolean
          Defaulttrue
          Description

          Set to false If a document with the specified _id already exists(conflict), the operation will fail.

        • max_retries
          TypeInteger(0..+inf)
          Default2
          Description

          HTTP request max retry times if failed.

        action_delete

        • action
          TypeString("delete")
          Description

          delete

        • index
          TypeString
          Description

          Name of index, or index alias to perform the action on. This parameter is required.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • id
          TypeString
          Description

          The document ID. If no ID is specified, a document ID is automatically generated.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • routing
          TypeString
          Description

          Custom value used to route operations to a specific shard.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • max_retries
          TypeInteger(0..+inf)
          Default2
          Description

          HTTP request max retry times if failed.

        action_update

        • action
          TypeString("update")
          Description

          update

        • index
          TypeString
          Description

          Name of index, or index alias to perform the action on. This parameter is required.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • id
          TypeString
          Description

          The document ID. If no ID is specified, a document ID is automatically generated.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • doc
          TypeString
          Description

          JSON document. If undefined, rule engine will use JSON format to serialize all visible inputs, such as clientid, topic, payload etc.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • doc_as_upsert
          TypeBoolean
          Defaultfalse
          Description

          Instead of sending a partial doc plus an upsert doc, you can set doc_as_upsert to true to use the contents of doc as the upsert value.

        • routing
          TypeString
          Description

          Custom value used to route operations to a specific shard.
          A string for ${.path.to.var} style value interpolation, where the leading dot is optional, and ${.} represents all values as an object.

        • require_alias
          TypeBoolean
          Description

          If true, the request’s actions must target an index alias. Defaults to false

        • max_retries
          TypeInteger(0..+inf)
          Default2
          Description

          HTTP request max retry times if failed.

      • resource_opts

        TypeStruct(action_resource_opts)
        Default{}
        Description

        Resource options.

        action_resource_opts

        • worker_pool_size
          TypeInteger(1..1024)
          Default16
          Description

          The number of buffer workers. Only applicable for egress type bridges. For bridges only have ingress direction data flow, it can be set to 0 otherwise must be greater than 0.

        • health_check_interval
          TypeDuration
          Default"15s"
          Description

          Health check interval.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • query_mode
          TypeEnum(sync,async)
          Defaultasync
          Description

          Query mode. Optional 'sync/async', default 'async'.

        • request_ttl
          Aliasesrequest_timeout
          TypeOneOf(Duration,String("infinity"))
          Default"45s"
          Description

          Starting from the moment when the request enters the buffer, if the request remains in the buffer for the specified time or is sent but does not receive a response or acknowledgement in time, the request is considered expired.

        • inflight_window
          Aliasesasync_inflight_window
          TypeInteger(1..+inf)
          Default100
          Description

          Query inflight window. When query_mode is set to async, this config has to be set to 1 if messages from the same MQTT client have to be strictly ordered.

        • max_buffer_bytes
          Aliasesmax_queue_bytes
          TypeBytesize
          Default"256MB"
          Description

          Maximum number of bytes to buffer for each buffer worker.
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

  • sources

    TypeStruct(sources)

    sources

    • mqtt

      TypeMap($name->Struct(mqtt_subscriber_source))
      Description

      MQTT Subscriber Source Config

      mqtt_subscriber_source

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Enable (true) or disable (false) this action.

      • connector

        TypeString
        Description

        Name of the connector specified by the action, used for external resource selection.

      • tags

        TypeArray(String)
        Description

        Tags to annotate this config entry.

      • description

        TypeString
        Default""
        Description

        Descriptive text.

      • parameters

        TypeStruct(ingress_parameters)

        ingress_parameters

        • topic
          TypeString
          Description

          Receive messages from which topic of the remote broker

        • qos
          TypeInteger(0..2)
          Default1
          Description

          The QoS level to be used when subscribing to the remote broker

      • resource_opts

        TypeStruct(source_resource_opts)
        Default{}
        Description

        Resource options.

        source_resource_opts

        • health_check_interval
          TypeDuration
          Default"15s"
          Description

          Health check interval.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

  • retainer

    TypeStruct(retainer)

    retainer

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Enable retainer feature

    • msg_expiry_interval

      TypeDuration
      Default"0s"
      Description

      Message retention time. This config is only applicable for messages without the Message Expiry Interval message property. 0 means message will never expire.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • msg_clear_interval

      TypeDuration
      Default"0s"
      Description

      Interval for EMQX to scan expired messages and delete them. Never scan if the value is 0.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • max_payload_size

      TypeBytesize
      Default"1MB"
      Description

      Maximum retained message size.
      A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

    • stop_publish_clear_msg

      TypeBoolean
      Defaultfalse
      Description

      When the retained flag of the PUBLISH message is set and Payload is empty, whether to continue to publish the message. See: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718038

    • delivery_rate

      Aliasesdeliver_rate
      TypeString
      Default"1000/s"
      Description

      The maximum rate of delivering retained messages

    • backend

      TypeStruct(mnesia_config)
      Description

      Settings for the database storing the retained messages.

      mnesia_config

      • type

        TypeString("built_in_database")
        Defaultbuilt_in_database
        Description

        Backend type.

      • storage_type

        TypeEnum(ram,disc)
        Defaultram
        Description

        Specifies whether the messages are stored in RAM or persisted on disc.

      • max_retained_messages

        TypeInteger(0..+inf)
        Default0
        Description

        Maximum number of retained messages. 0 means no limit.

      • index_specs

        TypeArray(Integer)
        Default[[1, 2, 3], [1, 3], [2, 3], [3]]
        Description

        Retainer index specifications: list of arrays of positive ascending integers. Each array specifies an index. Numbers in an index specification are 1-based word positions in topics. Words from specified positions will be used for indexing.
        For example, it is good to have [2, 4] index to optimize +/X/+/Y/... topic wildcard subscriptions.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Enable built-in Mnesia backend.

  • telemetry

    TypeStruct(telemetry)

    telemetry

    • enable

      TypeBoolean
      Description

      Set to false disable telemetry data report

  • delayed

    TypeStruct(delayed)

    delayed

    • enable

      TypeBoolean
      Defaulttrue
      Description

      Enable this feature

    • max_delayed_messages

      TypeInteger
      Default0
      Description

      Maximum number of delayed messages (0 is no limit).

  • plugins

    TypeStruct(plugins)

    plugins

    • states

      TypeArray(Struct(state))
      Default[]
      Description

      An array of plugins in the desired states.
      The plugins are started in the defined order

      state

      • name_vsn

        TypeString
        Description

        The {name}-{version} of the plugin.
        It should match the plugin application name-version as plugin release package name
        For example: my_plugin-0.1.0.

      • enable

        TypeBoolean
        Description

        Set to 'true' to enable this plugin

    • install_dir

      TypeString
      Defaultplugins
      Description

      The installation directory for the external plugins. The plugin beam files and configuration files should reside in the subdirectory named as emqx_foo_bar-0.1.0.
      NOTE: For security reasons, this directory should NOT be writable by anyone except emqx (or any user which runs EMQX).

    • check_interval

      TypeDuration
      Description

      Deprecated since 5.0.24.
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

  • dashboard

    TypeStruct(dashboard)

    dashboard

    • listeners

      TypeStruct(listeners)
      Description

      HTTP(s) listeners are identified by their protocol type and are used to serve dashboard UI and restful HTTP API. Listeners must have a unique combination of port number and IP address. For example, an HTTP listener can listen on all configured IP addresses on a given port for a machine by specifying the IP address 0.0.0.0. Alternatively, the HTTP listener can specify a unique IP address for each listener, but use the same port.

      listeners

      • http

        TypeStruct(http)
        Description

        TCP listeners

        http

        • bind
          TypeString
          Default0
          Description

          Port without IP(18083) or port with specified IP(127.0.0.1:18083). Disabled when setting bind to 0.

        • num_acceptors
          TypeInteger
          Default6
          Description

          Socket acceptor pool size for TCP protocols. Default is the number of schedulers online

        • max_connections
          TypeInteger
          Default512
          Description

          Maximum number of simultaneous connections.

        • backlog
          TypeInteger
          Default1024
          Description

          Defines the maximum length that the queue of pending connections can grow to.

        • send_timeout
          TypeDuration
          Default"10s"
          Description

          Send timeout for the socket.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • inet6
          TypeBoolean
          Defaultfalse
          Description

          Enable IPv6 support, default is false, which means IPv4 only.

        • ipv6_v6only
          TypeBoolean
          Defaultfalse
          Description

          Disable IPv4-to-IPv6 mapping for the listener. The configuration is only valid when the inet6 is true.

        • proxy_header
          TypeBoolean
          Defaultfalse
          Description

          Enable support for HAProxy header. Be aware once enabled regular HTTP requests can't be handled anymore.

      • https

        TypeStruct(https)
        Description

        SSL listeners

        https

        • bind
          TypeString
          Default0
          Description

          Port without IP(18083) or port with specified IP(127.0.0.1:18083). Disabled when setting bind to 0.

        • ssl_options
          TypeStruct(ssl_options)
          Description

          SSL/TLS options for the dashboard listener.

          ssl_options

          • cacertfile
            TypeString
            Default"${EMQX_ETC_DIR}/certs/cacert.pem"
            Description

            Trusted PEM format CA certificates bundle file.
            The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
            NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

          • cacerts
            TypeBoolean
            Description

            Deprecated since 5.1.4.

          • certfile
            TypeString
            Default"${EMQX_ETC_DIR}/certs/cert.pem"
            Description

            PEM format certificates chain file.
            The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

          • keyfile
            TypeString
            Default"${EMQX_ETC_DIR}/certs/key.pem"
            Description

            PEM format private key file.

          • verify
            TypeEnum(verify_peer,verify_none)
            Defaultverify_none
            Description

            Enable or disable peer verification.

          • reuse_sessions
            TypeBoolean
            Defaulttrue
            Description

            Enable TLS session reuse.
            Has no effect when TLS version is configured (or negotiated) to 1.3

          • depth
            TypeInteger(0..+inf)
            Default10
            Description

            Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
            if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
            if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

          • password
            TypeString
            Description

            String containing the user's password. Only used if the private key file is password-protected.

          • versions
            TypeArray(String)
            Default["tlsv1.3", "tlsv1.2"]
            Description

            All TLS/DTLS versions to be supported.
            NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
            In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

          • ciphers
            TypeArray(String)
            Default[]
            Description

            This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
            Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

            The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

            NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

            NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
            If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
            PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

          • secure_renegotiate
            TypeBoolean
            Defaulttrue
            Description

            SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
            Has no effect when TLS version is configured (or negotiated) to 1.3

          • log_level
            TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
            Defaultnotice
            Description

            Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

          • hibernate_after
            TypeDuration
            Default"5s"
            Description

            Hibernate the SSL process after idling for amount of time reducing its memory footprint.
            A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

          • dhfile
            TypeString
            Description

            Path to a file containing PEM-encoded Diffie-Hellman parameters to be used by the server if a cipher suite using Diffie-Hellman key exchange is negotiated. If not specified, default parameters are used.
            NOTE: The dhfile option is not supported by TLS 1.3.

          • honor_cipher_order
            TypeBoolean
            Defaulttrue
            Description

            An important security setting. It forces the cipher to be set based on the server-specified order instead of the client-specified order, hence enforcing the (usually more properly configured) security ordering of the server administrator.

          • client_renegotiation
            TypeBoolean
            Defaulttrue
            Description

            In protocols that support client-initiated renegotiation, the cost of resources of such an operation is higher for the server than the client. This can act as a vector for denial of service attacks. The SSL application already takes measures to counter-act such attempts, but client-initiated renegotiation can be strictly disabled by setting this option to false. The default value is true. Note that disabling renegotiation can result in long-lived connections becoming unusable due to limits on the number of messages the underlying cipher suite can encipher.
            Has no effect when TLS version is configured (or negotiated) to 1.3

          • handshake_timeout
            TypeDuration
            Default"15s"
            Description

            Maximum time duration allowed for the handshake to complete
            A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • num_acceptors
          TypeInteger
          Default6
          Description

          Socket acceptor pool size for TCP protocols. Default is the number of schedulers online

        • max_connections
          TypeInteger
          Default512
          Description

          Maximum number of simultaneous connections.

        • backlog
          TypeInteger
          Default1024
          Description

          Defines the maximum length that the queue of pending connections can grow to.

        • send_timeout
          TypeDuration
          Default"10s"
          Description

          Send timeout for the socket.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • inet6
          TypeBoolean
          Defaultfalse
          Description

          Enable IPv6 support, default is false, which means IPv4 only.

        • ipv6_v6only
          TypeBoolean
          Defaultfalse
          Description

          Disable IPv4-to-IPv6 mapping for the listener. The configuration is only valid when the inet6 is true.

        • proxy_header
          TypeBoolean
          Defaultfalse
          Description

          Enable support for HAProxy header. Be aware once enabled regular HTTP requests can't be handled anymore.

    • token_expired_time

      TypeDuration
      Default"60m"
      Description

      JWT token expiration time. Default is 60 minutes
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • cors

      TypeBoolean
      Defaultfalse
      Description

      Support Cross-Origin Resource Sharing (CORS). Allows a server to indicate any origins (domain, scheme, or port) other than its own from which a browser should permit loading resources.

    • swagger_support

      TypeBoolean
      Defaulttrue
      Description

      Enable or disable support for swagger API documentation.

  • gateway

    TypeStruct(gateway)

    gateway

    • coap

      TypeStruct(coap)

      coap

      • heartbeat

        TypeDuration
        Default"30s"
        Description

        The gateway server required minimum heartbeat interval. When connection mode is enabled, this parameter is used to set the minimum heartbeat interval for the connection to be alive
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • connection_required

        TypeBoolean
        Defaultfalse
        Description

        Enable or disable connection mode. Connection mode is a feature of non-standard protocols. When connection mode is enabled, it is necessary to maintain the creation, authentication and alive of connection resources

      • notify_type

        TypeEnum(non,con,qos)
        Defaultqos
        Description

        The Notification Message will be delivered to the CoAP client if a new message received on an observed topic. The type of delivered coap message can be set to:

        • non: Non-confirmable;
        • con: Confirmable;
        • qos: Mapping from QoS type of received message, QoS0 -> non, QoS1,2 -> con
      • subscribe_qos

        TypeEnum(qos0,qos1,qos2,coap)
        Defaultcoap
        Description

        The Default QoS Level indicator for subscribe request. This option specifies the QoS level for the CoAP Client when establishing a subscription membership, if the subscribe request is not carried qos option. The indicator can be set to:

        • qos0, qos1, qos2: Fixed default QoS level
        • coap: Dynamic QoS level by the message type of subscribe request
          • qos0: If the subscribe request is non-confirmable
          • qos1: If the subscribe request is confirmable
      • publish_qos

        TypeEnum(qos0,qos1,qos2,coap)
        Defaultcoap
        Description

        The Default QoS Level indicator for publish request. This option specifies the QoS level for the CoAP Client when publishing a message to EMQX PUB/SUB system, if the publish request is not carried qos option. The indicator can be set to:

        • qos0, qos1, qos2: Fixed default QoS level
        • coap: Dynamic QoS level by the message type of publish request
          • qos0: If the publish request is non-confirmable
          • qos1: If the publish request is confirmable
      • mountpoint

        TypeString
        Default""
        Description

        When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

        • ${clientid}: clientid
        • ${username}: username
        • ${endpoint_name}: endpoint name
      • listeners

        TypeStruct(udp_listeners)

        udp_listeners

        • udp
          TypeMap($name->Struct(udp_listener))
          Description

          A map from listener names to listener settings.

          udp_listener

          • udp_options
            TypeStruct(udp_opts)

            udp_opts

            • active_n
              TypeInteger
              Default100
              Description

              Specify the {active, N} option for the socket. See: https://erlang.org/doc/man/inet.html#setopts-2

            • recbuf
              TypeBytesize
              Description

              Size of the kernel-space receive buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • sndbuf
              TypeBytesize
              Description

              Size of the kernel-space send buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • buffer
              TypeBytesize
              Description

              Size of the user-space buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • reuseaddr
              TypeBoolean
              Defaulttrue
              Description

              Allow local reuse of port numbers.

          • enable
            TypeBoolean
            Defaulttrue
            Description

            Enable the listener.

          • bind
            TypeString
            Description

            The IP address and port that the listener will bind.

          • max_connections
            TypeOneOf(Integer(1..+inf),String("infinity"))
            Default1024
            Description

            Maximum number of concurrent connections.

          • max_conn_rate
            TypeInteger
            Default1000
            Description

            Maximum connections per second.

          • enable_authn
            TypeBoolean
            Defaulttrue
            Description

            Set true (default) to enable client authentication on this listener. When set to false clients will be allowed to connect without authentication.

          • mountpoint
            TypeString
            Description

            When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

            • ${clientid}: clientid
            • ${username}: username
            • ${endpoint_name}: endpoint name
          • access_rules
            TypeArray(String)
            Default[]
            Description

            The access control rules for this listener. See: https://github.com/emqtt/esockd#allowdeny

        • dtls
          TypeMap($name->Struct(dtls_listener))
          Description

          A map from listener names to listener settings.

          dtls_listener

          • acceptors
            TypeInteger
            Default16
            Description

            Size of the acceptor pool.

          • udp_options
            TypeStruct(udp_opts)

            udp_opts

            • active_n
              TypeInteger
              Default100
              Description

              Specify the {active, N} option for the socket. See: https://erlang.org/doc/man/inet.html#setopts-2

            • recbuf
              TypeBytesize
              Description

              Size of the kernel-space receive buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • sndbuf
              TypeBytesize
              Description

              Size of the kernel-space send buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • buffer
              TypeBytesize
              Description

              Size of the user-space buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • reuseaddr
              TypeBoolean
              Defaulttrue
              Description

              Allow local reuse of port numbers.

          • enable
            TypeBoolean
            Defaulttrue
            Description

            Enable the listener.

          • bind
            TypeString
            Description

            The IP address and port that the listener will bind.

          • max_connections
            TypeOneOf(Integer(1..+inf),String("infinity"))
            Default1024
            Description

            Maximum number of concurrent connections.

          • max_conn_rate
            TypeInteger
            Default1000
            Description

            Maximum connections per second.

          • enable_authn
            TypeBoolean
            Defaulttrue
            Description

            Set true (default) to enable client authentication on this listener. When set to false clients will be allowed to connect without authentication.

          • mountpoint
            TypeString
            Description

            When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

            • ${clientid}: clientid
            • ${username}: username
            • ${endpoint_name}: endpoint name
          • access_rules
            TypeArray(String)
            Default[]
            Description

            The access control rules for this listener. See: https://github.com/emqtt/esockd#allowdeny

          • dtls_options
            TypeStruct(dtls_opts)
            Description

            DTLS socket options

            dtls_opts

            • cacertfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/cacert.pem"
              Description

              Trusted PEM format CA certificates bundle file.
              The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
              NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

            • cacerts
              TypeBoolean
              Description

              Deprecated since 5.1.4.

            • certfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/cert.pem"
              Description

              PEM format certificates chain file.
              The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

            • keyfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/key.pem"
              Description

              PEM format private key file.

            • verify
              TypeEnum(verify_peer,verify_none)
              Defaultverify_none
              Description

              Enable or disable peer verification.

            • reuse_sessions
              TypeBoolean
              Defaulttrue
              Description

              Enable TLS session reuse.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • depth
              TypeInteger(0..+inf)
              Default10
              Description

              Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
              if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
              if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

            • password
              TypeString
              Description

              String containing the user's password. Only used if the private key file is password-protected.

            • versions
              TypeArray(String)
              Default["dtlsv1.2"]
              Description

              All TLS/DTLS versions to be supported.
              NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
              In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

            • ciphers
              TypeArray(String)
              Default[]
              Description

              This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
              Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

              The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

              NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

              NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
              If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
              PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

            • secure_renegotiate
              TypeBoolean
              Defaulttrue
              Description

              SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • log_level
              TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
              Defaultnotice
              Description

              Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

            • hibernate_after
              TypeDuration
              Default"5s"
              Description

              Hibernate the SSL process after idling for amount of time reducing its memory footprint.
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • dhfile
              TypeString
              Description

              Path to a file containing PEM-encoded Diffie-Hellman parameters to be used by the server if a cipher suite using Diffie-Hellman key exchange is negotiated. If not specified, default parameters are used.
              NOTE: The dhfile option is not supported by TLS 1.3.

            • fail_if_no_peer_cert
              TypeBoolean
              Defaultfalse
              Description

              Used together with {verify, verify_peer} by an TLS/DTLS server. If set to true, the server fails if the client does not have a certificate to send, that is, sends an empty certificate. If set to false, it fails only if the client sends an invalid certificate (an empty certificate is considered valid).

            • honor_cipher_order
              TypeBoolean
              Defaulttrue
              Description

              An important security setting. It forces the cipher to be set based on the server-specified order instead of the client-specified order, hence enforcing the (usually more properly configured) security ordering of the server administrator.

            • client_renegotiation
              TypeBoolean
              Defaulttrue
              Description

              In protocols that support client-initiated renegotiation, the cost of resources of such an operation is higher for the server than the client. This can act as a vector for denial of service attacks. The SSL application already takes measures to counter-act such attempts, but client-initiated renegotiation can be strictly disabled by setting this option to false. The default value is true. Note that disabling renegotiation can result in long-lived connections becoming unusable due to limits on the number of messages the underlying cipher suite can encipher.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • handshake_timeout
              TypeDuration
              Default"15s"
              Description

              Maximum time duration allowed for the handshake to complete
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • gc_after_handshake
              TypeBoolean
              Defaultfalse
              Description

              Memory usage tuning. If enabled, will immediately perform a garbage collection after the TLS/SSL handshake.

            • ocsp
              TypeStruct(ocsp)

              ocsp

              • enable_ocsp_stapling
                TypeBoolean
                Defaultfalse
                Description

                Whether to enable Online Certificate Status Protocol (OCSP) stapling for the listener. If set to true, requires defining the OCSP responder URL and issuer PEM path.

              • responder_url
                TypeString
                Description

                URL for the OCSP responder to check the server certificate against.

              • issuer_pem
                TypeString
                Description

                PEM-encoded certificate of the OCSP issuer for the server certificate.

              • refresh_interval
                TypeDuration
                Default"5m"
                Description

                The period to refresh the OCSP response for the server.
                A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

              • refresh_http_timeout
                TypeDuration
                Default"15s"
                Description

                The timeout for the HTTP request when checking OCSP responses.
                A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • enable_crl_check
              TypeBoolean
              Defaultfalse
              Description

              Whether to enable CRL verification for this listener.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Whether to enable this gateway

      • enable_stats

        TypeBoolean
        Defaulttrue
        Description

        Whether to enable client process statistic

      • idle_timeout

        TypeDuration
        Default"30s"
        Description

        The idle time of the client connection process. It has two purposes:

        1. A newly created client process that does not receive any client requests after that time will be closed directly.
        2. A running client process that does not receive any client requests after this time will go into hibernation to save resources.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.
      • clientinfo_override

        TypeStruct(clientinfo_override)
        Description

        ClientInfo override.

        clientinfo_override

        • username
          TypeString
          Description

          Template for overriding username.

        • password
          TypeString
          Description

          Template for overriding password.

        • clientid
          TypeString
          Description

          Template for overriding clientid.

    • exproto

      TypeStruct(exproto)

      exproto

      • server

        TypeStruct(exproto_grpc_server)
        Description

        Configurations for starting the ConnectionAdapter service

        exproto_grpc_server

        • bind
          TypeString
          Description

          Listening address and port for the gRPC server.

        • ssl_options
          TypeStruct(ssl_server_opts)
          Description

          SSL configuration for the gRPC server.

          ssl_server_opts

          • cacertfile
            TypeString
            Default"${EMQX_ETC_DIR}/certs/cacert.pem"
            Description

            Trusted PEM format CA certificates bundle file.
            The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
            NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

          • cacerts
            TypeBoolean
            Description

            Deprecated since 5.1.4.

          • certfile
            TypeString
            Default"${EMQX_ETC_DIR}/certs/cert.pem"
            Description

            PEM format certificates chain file.
            The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

          • keyfile
            TypeString
            Default"${EMQX_ETC_DIR}/certs/key.pem"
            Description

            PEM format private key file.

          • verify
            TypeEnum(verify_peer,verify_none)
            Defaultverify_none
            Description

            Enable or disable peer verification.

          • reuse_sessions
            TypeBoolean
            Defaulttrue
            Description

            Enable TLS session reuse.
            Has no effect when TLS version is configured (or negotiated) to 1.3

          • depth
            TypeInteger(0..+inf)
            Default10
            Description

            Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
            if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
            if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

          • password
            TypeString
            Description

            String containing the user's password. Only used if the private key file is password-protected.

          • versions
            TypeArray(String)
            Default["tlsv1.3", "tlsv1.2"]
            Description

            All TLS/DTLS versions to be supported.
            NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
            In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

          • ciphers
            TypeArray(String)
            Default[]
            Description

            This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
            Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

            The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

            NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

            NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
            If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
            PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

          • secure_renegotiate
            TypeBoolean
            Defaulttrue
            Description

            SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
            Has no effect when TLS version is configured (or negotiated) to 1.3

          • log_level
            TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
            Defaultnotice
            Description

            Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

          • hibernate_after
            TypeDuration
            Default"5s"
            Description

            Hibernate the SSL process after idling for amount of time reducing its memory footprint.
            A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

          • dhfile
            TypeString
            Description

            Path to a file containing PEM-encoded Diffie-Hellman parameters to be used by the server if a cipher suite using Diffie-Hellman key exchange is negotiated. If not specified, default parameters are used.
            NOTE: The dhfile option is not supported by TLS 1.3.

          • fail_if_no_peer_cert
            TypeBoolean
            Defaultfalse
            Description

            Used together with {verify, verify_peer} by an TLS/DTLS server. If set to true, the server fails if the client does not have a certificate to send, that is, sends an empty certificate. If set to false, it fails only if the client sends an invalid certificate (an empty certificate is considered valid).

          • honor_cipher_order
            TypeBoolean
            Defaulttrue
            Description

            An important security setting. It forces the cipher to be set based on the server-specified order instead of the client-specified order, hence enforcing the (usually more properly configured) security ordering of the server administrator.

          • client_renegotiation
            TypeBoolean
            Defaulttrue
            Description

            In protocols that support client-initiated renegotiation, the cost of resources of such an operation is higher for the server than the client. This can act as a vector for denial of service attacks. The SSL application already takes measures to counter-act such attempts, but client-initiated renegotiation can be strictly disabled by setting this option to false. The default value is true. Note that disabling renegotiation can result in long-lived connections becoming unusable due to limits on the number of messages the underlying cipher suite can encipher.
            Has no effect when TLS version is configured (or negotiated) to 1.3

          • handshake_timeout
            TypeDuration
            Default"15s"
            Description

            Maximum time duration allowed for the handshake to complete
            A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • handler

        TypeStruct(exproto_grpc_handler)
        Description

        Configurations for request to ConnectionHandler service

        exproto_grpc_handler

        • address
          TypeString
          Description

          gRPC server address.

        • service_name
          TypeOneOf(String("ConnectionHandler"),String("ConnectionUnaryHandler"))
          DefaultConnectionUnaryHandler
          Description

          The service name to handle the connection events. In the initial version, we expected to use streams to improve the efficiency of requests in ConnectionHandler. But unfortunately, events between different streams are out of order. It causes the OnSocketCreated event to may arrive later than OnReceivedBytes. So we added the ConnectionUnaryHandler service since v5.0.25 and forced the use of Unary in it to avoid ordering problems.

        • ssl_options
          TypeStruct(ssl_client_opts)
          Description

          SSL configuration for the gRPC client.

          ssl_client_opts

          • cacertfile
            TypeString
            Description

            Trusted PEM format CA certificates bundle file.
            The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
            NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

          • cacerts
            TypeBoolean
            Description

            Deprecated since 5.1.4.

          • certfile
            TypeString
            Description

            PEM format certificates chain file.
            The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

          • keyfile
            TypeString
            Description

            PEM format private key file.

          • verify
            TypeEnum(verify_peer,verify_none)
            Defaultverify_none
            Description

            Enable or disable peer verification.

          • reuse_sessions
            TypeBoolean
            Defaulttrue
            Description

            Enable TLS session reuse.
            Has no effect when TLS version is configured (or negotiated) to 1.3

          • depth
            TypeInteger(0..+inf)
            Default10
            Description

            Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
            if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
            if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

          • password
            TypeString
            Description

            String containing the user's password. Only used if the private key file is password-protected.

          • versions
            TypeArray(String)
            Default["tlsv1.3", "tlsv1.2"]
            Description

            All TLS/DTLS versions to be supported.
            NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
            In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

          • ciphers
            TypeArray(String)
            Default[]
            Description

            This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
            Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

            The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

            NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

            NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
            If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
            PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

          • secure_renegotiate
            TypeBoolean
            Defaulttrue
            Description

            SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
            Has no effect when TLS version is configured (or negotiated) to 1.3

          • log_level
            TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
            Defaultnotice
            Description

            Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

          • hibernate_after
            TypeDuration
            Default"5s"
            Description

            Hibernate the SSL process after idling for amount of time reducing its memory footprint.
            A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

          • enable
            TypeBoolean
            Defaultfalse
            Description

            Enable TLS.

          • server_name_indication
            TypeOneOf(String("disable"),String)
            Description

            Specify the host name to be used in TLS Server Name Indication extension.
            For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
            If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
            The host name is then also used in the host name verification of the peer certificate.
            The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

      • mountpoint

        TypeString
        Default""
        Description

        When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

        • ${clientid}: clientid
        • ${username}: username
        • ${endpoint_name}: endpoint name
      • listeners

        TypeStruct(tcp_udp_listeners)

        tcp_udp_listeners

        • tcp
          TypeMap($name->Struct(tcp_listener))
          Description

          A map from listener names to listener settings.

          tcp_listener

          • acceptors
            TypeInteger
            Default16
            Description

            Size of the acceptor pool.

          • tcp_options
            TypeStruct(tcp_opts)
            Description

            Setting the TCP socket options.

            tcp_opts

            • active_n
              TypeInteger
              Default100
              Description

              Specify the {active, N} option for this Socket.
              See: https://erlang.org/doc/man/inet.html#setopts-2

            • backlog
              TypeInteger(1..+inf)
              Default1024
              Description

              TCP backlog defines the maximum length that the queue of pending connections can grow to.

            • send_timeout
              TypeDuration
              Default"15s"
              Description

              The TCP send timeout for the connections.
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • send_timeout_close
              TypeBoolean
              Defaulttrue
              Description

              Close the connection if send timeout.

            • recbuf
              TypeBytesize
              Description

              The TCP receive buffer (OS kernel) for the connections.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • sndbuf
              TypeBytesize
              Description

              The TCP send buffer (OS kernel) for the connections.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • buffer
              TypeBytesize
              Default"4KB"
              Description

              The size of the user-space buffer used by the driver.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • high_watermark
              TypeBytesize
              Default"1MB"
              Description

              The socket is set to a busy state when the amount of data queued internally by the VM socket implementation reaches this limit.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • nodelay
              TypeBoolean
              Defaulttrue
              Description

              The TCP_NODELAY flag for the connections.

            • reuseaddr
              TypeBoolean
              Defaulttrue
              Description

              The SO_REUSEADDR flag for the connections.

            • keepalive
              TypeString
              Defaultnone
              Description

              Enable TCP keepalive for MQTT connections over TCP or SSL. The value is three comma separated numbers in the format of 'Idle,Interval,Probes'

              • Idle: The number of seconds a connection needs to be idle before the server begins to send out keep-alive probes (Linux default 7200).
              • Interval: The number of seconds between TCP keep-alive probes (Linux default 75).
              • Probes: The maximum number of TCP keep-alive probes to send before giving up and killing the connection if no response is obtained from the other end (Linux default 9). For example "240,30,5" means: EMQX should start sending TCP keepalive probes after the connection is in idle for 240 seconds, and the probes are sent every 30 seconds until a response is received from the MQTT client, if it misses 5 consecutive responses, EMQX should close the connection. Default: 'none'
          • proxy_protocol
            TypeBoolean
            Defaultfalse
            Description

            Enable the Proxy Protocol V1/2 if the EMQX cluster is deployed behind HAProxy or Nginx. See: https://www.haproxy.com/blog/haproxy/proxy-protocol/

          • proxy_protocol_timeout
            TypeDuration
            Default"3s"
            Description

            Timeout for proxy protocol. EMQX will close the TCP connection if proxy protocol packet is not received within the timeout.
            A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

          • enable
            TypeBoolean
            Defaulttrue
            Description

            Enable the listener.

          • bind
            TypeString
            Description

            The IP address and port that the listener will bind.

          • max_connections
            TypeOneOf(Integer(1..+inf),String("infinity"))
            Default1024
            Description

            Maximum number of concurrent connections.

          • max_conn_rate
            TypeInteger
            Default1000
            Description

            Maximum connections per second.

          • enable_authn
            TypeBoolean
            Defaulttrue
            Description

            Set true (default) to enable client authentication on this listener. When set to false clients will be allowed to connect without authentication.

          • mountpoint
            TypeString
            Description

            When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

            • ${clientid}: clientid
            • ${username}: username
            • ${endpoint_name}: endpoint name
          • access_rules
            TypeArray(String)
            Default[]
            Description

            The access control rules for this listener. See: https://github.com/emqtt/esockd#allowdeny

        • ssl
          TypeMap($name->Struct(ssl_listener))
          Description

          A map from listener names to listener settings.

          ssl_listener

          • acceptors
            TypeInteger
            Default16
            Description

            Size of the acceptor pool.

          • tcp_options
            TypeStruct(tcp_opts)
            Description

            Setting the TCP socket options.

            tcp_opts

            • active_n
              TypeInteger
              Default100
              Description

              Specify the {active, N} option for this Socket.
              See: https://erlang.org/doc/man/inet.html#setopts-2

            • backlog
              TypeInteger(1..+inf)
              Default1024
              Description

              TCP backlog defines the maximum length that the queue of pending connections can grow to.

            • send_timeout
              TypeDuration
              Default"15s"
              Description

              The TCP send timeout for the connections.
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • send_timeout_close
              TypeBoolean
              Defaulttrue
              Description

              Close the connection if send timeout.

            • recbuf
              TypeBytesize
              Description

              The TCP receive buffer (OS kernel) for the connections.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • sndbuf
              TypeBytesize
              Description

              The TCP send buffer (OS kernel) for the connections.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • buffer
              TypeBytesize
              Default"4KB"
              Description

              The size of the user-space buffer used by the driver.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • high_watermark
              TypeBytesize
              Default"1MB"
              Description

              The socket is set to a busy state when the amount of data queued internally by the VM socket implementation reaches this limit.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • nodelay
              TypeBoolean
              Defaulttrue
              Description

              The TCP_NODELAY flag for the connections.

            • reuseaddr
              TypeBoolean
              Defaulttrue
              Description

              The SO_REUSEADDR flag for the connections.

            • keepalive
              TypeString
              Defaultnone
              Description

              Enable TCP keepalive for MQTT connections over TCP or SSL. The value is three comma separated numbers in the format of 'Idle,Interval,Probes'

              • Idle: The number of seconds a connection needs to be idle before the server begins to send out keep-alive probes (Linux default 7200).
              • Interval: The number of seconds between TCP keep-alive probes (Linux default 75).
              • Probes: The maximum number of TCP keep-alive probes to send before giving up and killing the connection if no response is obtained from the other end (Linux default 9). For example "240,30,5" means: EMQX should start sending TCP keepalive probes after the connection is in idle for 240 seconds, and the probes are sent every 30 seconds until a response is received from the MQTT client, if it misses 5 consecutive responses, EMQX should close the connection. Default: 'none'
          • proxy_protocol
            TypeBoolean
            Defaultfalse
            Description

            Enable the Proxy Protocol V1/2 if the EMQX cluster is deployed behind HAProxy or Nginx. See: https://www.haproxy.com/blog/haproxy/proxy-protocol/

          • proxy_protocol_timeout
            TypeDuration
            Default"3s"
            Description

            Timeout for proxy protocol. EMQX will close the TCP connection if proxy protocol packet is not received within the timeout.
            A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

          • enable
            TypeBoolean
            Defaulttrue
            Description

            Enable the listener.

          • bind
            TypeString
            Description

            The IP address and port that the listener will bind.

          • max_connections
            TypeOneOf(Integer(1..+inf),String("infinity"))
            Default1024
            Description

            Maximum number of concurrent connections.

          • max_conn_rate
            TypeInteger
            Default1000
            Description

            Maximum connections per second.

          • enable_authn
            TypeBoolean
            Defaulttrue
            Description

            Set true (default) to enable client authentication on this listener. When set to false clients will be allowed to connect without authentication.

          • mountpoint
            TypeString
            Description

            When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

            • ${clientid}: clientid
            • ${username}: username
            • ${endpoint_name}: endpoint name
          • access_rules
            TypeArray(String)
            Default[]
            Description

            The access control rules for this listener. See: https://github.com/emqtt/esockd#allowdeny

          • ssl_options
            TypeStruct(listener_ssl_opts)
            Description

            SSL Socket options.

            listener_ssl_opts

            • cacertfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/cacert.pem"
              Description

              Trusted PEM format CA certificates bundle file.
              The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
              NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

            • cacerts
              TypeBoolean
              Description

              Deprecated since 5.1.4.

            • certfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/cert.pem"
              Description

              PEM format certificates chain file.
              The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

            • keyfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/key.pem"
              Description

              PEM format private key file.

            • verify
              TypeEnum(verify_peer,verify_none)
              Defaultverify_none
              Description

              Enable or disable peer verification.

            • reuse_sessions
              TypeBoolean
              Defaulttrue
              Description

              Enable TLS session reuse.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • depth
              TypeInteger(0..+inf)
              Default10
              Description

              Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
              if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
              if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

            • password
              TypeString
              Description

              String containing the user's password. Only used if the private key file is password-protected.

            • versions
              TypeArray(String)
              Default["tlsv1.3", "tlsv1.2"]
              Description

              All TLS/DTLS versions to be supported.
              NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
              In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

            • ciphers
              TypeArray(String)
              Default[]
              Description

              This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
              Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

              The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

              NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

              NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
              If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
              PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

            • secure_renegotiate
              TypeBoolean
              Defaulttrue
              Description

              SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • log_level
              TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
              Defaultnotice
              Description

              Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

            • hibernate_after
              TypeDuration
              Default"5s"
              Description

              Hibernate the SSL process after idling for amount of time reducing its memory footprint.
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • dhfile
              TypeString
              Description

              Path to a file containing PEM-encoded Diffie-Hellman parameters to be used by the server if a cipher suite using Diffie-Hellman key exchange is negotiated. If not specified, default parameters are used.
              NOTE: The dhfile option is not supported by TLS 1.3.

            • fail_if_no_peer_cert
              TypeBoolean
              Defaultfalse
              Description

              Used together with {verify, verify_peer} by an TLS/DTLS server. If set to true, the server fails if the client does not have a certificate to send, that is, sends an empty certificate. If set to false, it fails only if the client sends an invalid certificate (an empty certificate is considered valid).

            • honor_cipher_order
              TypeBoolean
              Defaulttrue
              Description

              An important security setting. It forces the cipher to be set based on the server-specified order instead of the client-specified order, hence enforcing the (usually more properly configured) security ordering of the server administrator.

            • client_renegotiation
              TypeBoolean
              Defaulttrue
              Description

              In protocols that support client-initiated renegotiation, the cost of resources of such an operation is higher for the server than the client. This can act as a vector for denial of service attacks. The SSL application already takes measures to counter-act such attempts, but client-initiated renegotiation can be strictly disabled by setting this option to false. The default value is true. Note that disabling renegotiation can result in long-lived connections becoming unusable due to limits on the number of messages the underlying cipher suite can encipher.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • handshake_timeout
              TypeDuration
              Default"15s"
              Description

              Maximum time duration allowed for the handshake to complete
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • gc_after_handshake
              TypeBoolean
              Defaultfalse
              Description

              Memory usage tuning. If enabled, will immediately perform a garbage collection after the TLS/SSL handshake.

            • ocsp
              TypeStruct(ocsp)

              ocsp

              • enable_ocsp_stapling
                TypeBoolean
                Defaultfalse
                Description

                Whether to enable Online Certificate Status Protocol (OCSP) stapling for the listener. If set to true, requires defining the OCSP responder URL and issuer PEM path.

              • responder_url
                TypeString
                Description

                URL for the OCSP responder to check the server certificate against.

              • issuer_pem
                TypeString
                Description

                PEM-encoded certificate of the OCSP issuer for the server certificate.

              • refresh_interval
                TypeDuration
                Default"5m"
                Description

                The period to refresh the OCSP response for the server.
                A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

              • refresh_http_timeout
                TypeDuration
                Default"15s"
                Description

                The timeout for the HTTP request when checking OCSP responses.
                A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • enable_crl_check
              TypeBoolean
              Defaultfalse
              Description

              Whether to enable CRL verification for this listener.

        • udp
          TypeMap($name->Struct(udp_listener))
          Description

          A map from listener names to listener settings.

          udp_listener

          • udp_options
            TypeStruct(udp_opts)

            udp_opts

            • active_n
              TypeInteger
              Default100
              Description

              Specify the {active, N} option for the socket. See: https://erlang.org/doc/man/inet.html#setopts-2

            • recbuf
              TypeBytesize
              Description

              Size of the kernel-space receive buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • sndbuf
              TypeBytesize
              Description

              Size of the kernel-space send buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • buffer
              TypeBytesize
              Description

              Size of the user-space buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • reuseaddr
              TypeBoolean
              Defaulttrue
              Description

              Allow local reuse of port numbers.

          • enable
            TypeBoolean
            Defaulttrue
            Description

            Enable the listener.

          • bind
            TypeString
            Description

            The IP address and port that the listener will bind.

          • max_connections
            TypeOneOf(Integer(1..+inf),String("infinity"))
            Default1024
            Description

            Maximum number of concurrent connections.

          • max_conn_rate
            TypeInteger
            Default1000
            Description

            Maximum connections per second.

          • enable_authn
            TypeBoolean
            Defaulttrue
            Description

            Set true (default) to enable client authentication on this listener. When set to false clients will be allowed to connect without authentication.

          • mountpoint
            TypeString
            Description

            When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

            • ${clientid}: clientid
            • ${username}: username
            • ${endpoint_name}: endpoint name
          • access_rules
            TypeArray(String)
            Default[]
            Description

            The access control rules for this listener. See: https://github.com/emqtt/esockd#allowdeny

        • dtls
          TypeMap($name->Struct(dtls_listener))
          Description

          A map from listener names to listener settings.

          dtls_listener

          • acceptors
            TypeInteger
            Default16
            Description

            Size of the acceptor pool.

          • udp_options
            TypeStruct(udp_opts)

            udp_opts

            • active_n
              TypeInteger
              Default100
              Description

              Specify the {active, N} option for the socket. See: https://erlang.org/doc/man/inet.html#setopts-2

            • recbuf
              TypeBytesize
              Description

              Size of the kernel-space receive buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • sndbuf
              TypeBytesize
              Description

              Size of the kernel-space send buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • buffer
              TypeBytesize
              Description

              Size of the user-space buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • reuseaddr
              TypeBoolean
              Defaulttrue
              Description

              Allow local reuse of port numbers.

          • enable
            TypeBoolean
            Defaulttrue
            Description

            Enable the listener.

          • bind
            TypeString
            Description

            The IP address and port that the listener will bind.

          • max_connections
            TypeOneOf(Integer(1..+inf),String("infinity"))
            Default1024
            Description

            Maximum number of concurrent connections.

          • max_conn_rate
            TypeInteger
            Default1000
            Description

            Maximum connections per second.

          • enable_authn
            TypeBoolean
            Defaulttrue
            Description

            Set true (default) to enable client authentication on this listener. When set to false clients will be allowed to connect without authentication.

          • mountpoint
            TypeString
            Description

            When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

            • ${clientid}: clientid
            • ${username}: username
            • ${endpoint_name}: endpoint name
          • access_rules
            TypeArray(String)
            Default[]
            Description

            The access control rules for this listener. See: https://github.com/emqtt/esockd#allowdeny

          • dtls_options
            TypeStruct(dtls_opts)
            Description

            DTLS socket options

            dtls_opts

            • cacertfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/cacert.pem"
              Description

              Trusted PEM format CA certificates bundle file.
              The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
              NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

            • cacerts
              TypeBoolean
              Description

              Deprecated since 5.1.4.

            • certfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/cert.pem"
              Description

              PEM format certificates chain file.
              The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

            • keyfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/key.pem"
              Description

              PEM format private key file.

            • verify
              TypeEnum(verify_peer,verify_none)
              Defaultverify_none
              Description

              Enable or disable peer verification.

            • reuse_sessions
              TypeBoolean
              Defaulttrue
              Description

              Enable TLS session reuse.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • depth
              TypeInteger(0..+inf)
              Default10
              Description

              Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
              if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
              if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

            • password
              TypeString
              Description

              String containing the user's password. Only used if the private key file is password-protected.

            • versions
              TypeArray(String)
              Default["dtlsv1.2"]
              Description

              All TLS/DTLS versions to be supported.
              NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
              In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

            • ciphers
              TypeArray(String)
              Default[]
              Description

              This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
              Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

              The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

              NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

              NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
              If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
              PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

            • secure_renegotiate
              TypeBoolean
              Defaulttrue
              Description

              SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • log_level
              TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
              Defaultnotice
              Description

              Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

            • hibernate_after
              TypeDuration
              Default"5s"
              Description

              Hibernate the SSL process after idling for amount of time reducing its memory footprint.
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • dhfile
              TypeString
              Description

              Path to a file containing PEM-encoded Diffie-Hellman parameters to be used by the server if a cipher suite using Diffie-Hellman key exchange is negotiated. If not specified, default parameters are used.
              NOTE: The dhfile option is not supported by TLS 1.3.

            • fail_if_no_peer_cert
              TypeBoolean
              Defaultfalse
              Description

              Used together with {verify, verify_peer} by an TLS/DTLS server. If set to true, the server fails if the client does not have a certificate to send, that is, sends an empty certificate. If set to false, it fails only if the client sends an invalid certificate (an empty certificate is considered valid).

            • honor_cipher_order
              TypeBoolean
              Defaulttrue
              Description

              An important security setting. It forces the cipher to be set based on the server-specified order instead of the client-specified order, hence enforcing the (usually more properly configured) security ordering of the server administrator.

            • client_renegotiation
              TypeBoolean
              Defaulttrue
              Description

              In protocols that support client-initiated renegotiation, the cost of resources of such an operation is higher for the server than the client. This can act as a vector for denial of service attacks. The SSL application already takes measures to counter-act such attempts, but client-initiated renegotiation can be strictly disabled by setting this option to false. The default value is true. Note that disabling renegotiation can result in long-lived connections becoming unusable due to limits on the number of messages the underlying cipher suite can encipher.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • handshake_timeout
              TypeDuration
              Default"15s"
              Description

              Maximum time duration allowed for the handshake to complete
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • gc_after_handshake
              TypeBoolean
              Defaultfalse
              Description

              Memory usage tuning. If enabled, will immediately perform a garbage collection after the TLS/SSL handshake.

            • ocsp
              TypeStruct(ocsp)

              ocsp

              • enable_ocsp_stapling
                TypeBoolean
                Defaultfalse
                Description

                Whether to enable Online Certificate Status Protocol (OCSP) stapling for the listener. If set to true, requires defining the OCSP responder URL and issuer PEM path.

              • responder_url
                TypeString
                Description

                URL for the OCSP responder to check the server certificate against.

              • issuer_pem
                TypeString
                Description

                PEM-encoded certificate of the OCSP issuer for the server certificate.

              • refresh_interval
                TypeDuration
                Default"5m"
                Description

                The period to refresh the OCSP response for the server.
                A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

              • refresh_http_timeout
                TypeDuration
                Default"15s"
                Description

                The timeout for the HTTP request when checking OCSP responses.
                A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • enable_crl_check
              TypeBoolean
              Defaultfalse
              Description

              Whether to enable CRL verification for this listener.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Whether to enable this gateway

      • enable_stats

        TypeBoolean
        Defaulttrue
        Description

        Whether to enable client process statistic

      • idle_timeout

        TypeDuration
        Default"30s"
        Description

        The idle time of the client connection process. It has two purposes:

        1. A newly created client process that does not receive any client requests after that time will be closed directly.
        2. A running client process that does not receive any client requests after this time will go into hibernation to save resources.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.
      • clientinfo_override

        TypeStruct(clientinfo_override)
        Description

        ClientInfo override.

        clientinfo_override

        • username
          TypeString
          Description

          Template for overriding username.

        • password
          TypeString
          Description

          Template for overriding password.

        • clientid
          TypeString
          Description

          Template for overriding clientid.

    • lwm2m

      TypeStruct(lwm2m)

      lwm2m

      • xml_dir

        TypeString
        Description

        The Directory for LwM2M Resource definition.

      • lifetime_min

        TypeDuration
        Default"15s"
        Description

        Minimum value of lifetime allowed to be set by the LwM2M client.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • lifetime_max

        TypeDuration
        Default"86400s"
        Description

        Maximum value of lifetime allowed to be set by the LwM2M client.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • qmode_time_window

        TypeDuration(s)
        Default"22s"
        Description

        The value of the time window during which the network link is considered valid by the LwM2M Gateway in QMode mode. For example, after receiving an update message from a client, any messages within this time window are sent directly to the LwM2M client, and all messages beyond this time window are temporarily stored in memory.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • auto_observe

        TypeBoolean
        Defaultfalse
        Description

        Automatically observe the object list of REGISTER packet.

      • update_msg_publish_condition

        TypeEnum(always,contains_object_list)
        Defaultcontains_object_list
        Description

        Policy for publishing UPDATE event message.

        • always: send update events as long as the UPDATE request is received.
        • contains_object_list: send update events only if the UPDATE request carries any Object List
      • translators

        TypeStruct(lwm2m_translators)
        Description

        Topic configuration for LwM2M's gateway publishing and subscription.

        lwm2m_translators

        • command
          TypeStruct(translator)
          Description

          The topic for receiving downstream commands. For each new LwM2M client that succeeds in going online, the gateway creates a subscription relationship to receive downstream commands and send it to the LwM2M client

          translator

          • topic
            TypeString
            Description

            Topic Name

          • qos
            TypeInteger(0..2)
            Default0
            Description

            QoS Level

        • response
          TypeStruct(translator)
          Description

          The topic for gateway to publish the acknowledge events from LwM2M client

          translator

          • topic
            TypeString
            Description

            Topic Name

          • qos
            TypeInteger(0..2)
            Default0
            Description

            QoS Level

        • notify
          TypeStruct(translator)
          Description

          The topic for gateway to publish the notify events from LwM2M client. After succeed observe a resource of LwM2M client, Gateway will send the notify events via this topic, if the client reports any resource changes

          translator

          • topic
            TypeString
            Description

            Topic Name

          • qos
            TypeInteger(0..2)
            Default0
            Description

            QoS Level

        • register
          TypeStruct(translator)
          Description

          The topic for gateway to publish the register events from LwM2M client.

          translator

          • topic
            TypeString
            Description

            Topic Name

          • qos
            TypeInteger(0..2)
            Default0
            Description

            QoS Level

        • update
          TypeStruct(translator)
          Description

          The topic for gateway to publish the update events from LwM2M client

          translator

          • topic
            TypeString
            Description

            Topic Name

          • qos
            TypeInteger(0..2)
            Default0
            Description

            QoS Level

      • mountpoint

        TypeString
        Default"lwm2m/${endpoint_name}/"
        Description

        When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

        • ${clientid}: clientid
        • ${username}: username
        • ${endpoint_name}: endpoint name
      • listeners

        TypeStruct(udp_listeners)

        udp_listeners

        • udp
          TypeMap($name->Struct(udp_listener))
          Description

          A map from listener names to listener settings.

          udp_listener

          • udp_options
            TypeStruct(udp_opts)

            udp_opts

            • active_n
              TypeInteger
              Default100
              Description

              Specify the {active, N} option for the socket. See: https://erlang.org/doc/man/inet.html#setopts-2

            • recbuf
              TypeBytesize
              Description

              Size of the kernel-space receive buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • sndbuf
              TypeBytesize
              Description

              Size of the kernel-space send buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • buffer
              TypeBytesize
              Description

              Size of the user-space buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • reuseaddr
              TypeBoolean
              Defaulttrue
              Description

              Allow local reuse of port numbers.

          • enable
            TypeBoolean
            Defaulttrue
            Description

            Enable the listener.

          • bind
            TypeString
            Description

            The IP address and port that the listener will bind.

          • max_connections
            TypeOneOf(Integer(1..+inf),String("infinity"))
            Default1024
            Description

            Maximum number of concurrent connections.

          • max_conn_rate
            TypeInteger
            Default1000
            Description

            Maximum connections per second.

          • enable_authn
            TypeBoolean
            Defaulttrue
            Description

            Set true (default) to enable client authentication on this listener. When set to false clients will be allowed to connect without authentication.

          • mountpoint
            TypeString
            Description

            When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

            • ${clientid}: clientid
            • ${username}: username
            • ${endpoint_name}: endpoint name
          • access_rules
            TypeArray(String)
            Default[]
            Description

            The access control rules for this listener. See: https://github.com/emqtt/esockd#allowdeny

        • dtls
          TypeMap($name->Struct(dtls_listener))
          Description

          A map from listener names to listener settings.

          dtls_listener

          • acceptors
            TypeInteger
            Default16
            Description

            Size of the acceptor pool.

          • udp_options
            TypeStruct(udp_opts)

            udp_opts

            • active_n
              TypeInteger
              Default100
              Description

              Specify the {active, N} option for the socket. See: https://erlang.org/doc/man/inet.html#setopts-2

            • recbuf
              TypeBytesize
              Description

              Size of the kernel-space receive buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • sndbuf
              TypeBytesize
              Description

              Size of the kernel-space send buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • buffer
              TypeBytesize
              Description

              Size of the user-space buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • reuseaddr
              TypeBoolean
              Defaulttrue
              Description

              Allow local reuse of port numbers.

          • enable
            TypeBoolean
            Defaulttrue
            Description

            Enable the listener.

          • bind
            TypeString
            Description

            The IP address and port that the listener will bind.

          • max_connections
            TypeOneOf(Integer(1..+inf),String("infinity"))
            Default1024
            Description

            Maximum number of concurrent connections.

          • max_conn_rate
            TypeInteger
            Default1000
            Description

            Maximum connections per second.

          • enable_authn
            TypeBoolean
            Defaulttrue
            Description

            Set true (default) to enable client authentication on this listener. When set to false clients will be allowed to connect without authentication.

          • mountpoint
            TypeString
            Description

            When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

            • ${clientid}: clientid
            • ${username}: username
            • ${endpoint_name}: endpoint name
          • access_rules
            TypeArray(String)
            Default[]
            Description

            The access control rules for this listener. See: https://github.com/emqtt/esockd#allowdeny

          • dtls_options
            TypeStruct(dtls_opts)
            Description

            DTLS socket options

            dtls_opts

            • cacertfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/cacert.pem"
              Description

              Trusted PEM format CA certificates bundle file.
              The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
              NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

            • cacerts
              TypeBoolean
              Description

              Deprecated since 5.1.4.

            • certfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/cert.pem"
              Description

              PEM format certificates chain file.
              The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

            • keyfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/key.pem"
              Description

              PEM format private key file.

            • verify
              TypeEnum(verify_peer,verify_none)
              Defaultverify_none
              Description

              Enable or disable peer verification.

            • reuse_sessions
              TypeBoolean
              Defaulttrue
              Description

              Enable TLS session reuse.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • depth
              TypeInteger(0..+inf)
              Default10
              Description

              Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
              if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
              if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

            • password
              TypeString
              Description

              String containing the user's password. Only used if the private key file is password-protected.

            • versions
              TypeArray(String)
              Default["dtlsv1.2"]
              Description

              All TLS/DTLS versions to be supported.
              NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
              In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

            • ciphers
              TypeArray(String)
              Default[]
              Description

              This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
              Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

              The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

              NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

              NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
              If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
              PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

            • secure_renegotiate
              TypeBoolean
              Defaulttrue
              Description

              SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • log_level
              TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
              Defaultnotice
              Description

              Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

            • hibernate_after
              TypeDuration
              Default"5s"
              Description

              Hibernate the SSL process after idling for amount of time reducing its memory footprint.
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • dhfile
              TypeString
              Description

              Path to a file containing PEM-encoded Diffie-Hellman parameters to be used by the server if a cipher suite using Diffie-Hellman key exchange is negotiated. If not specified, default parameters are used.
              NOTE: The dhfile option is not supported by TLS 1.3.

            • fail_if_no_peer_cert
              TypeBoolean
              Defaultfalse
              Description

              Used together with {verify, verify_peer} by an TLS/DTLS server. If set to true, the server fails if the client does not have a certificate to send, that is, sends an empty certificate. If set to false, it fails only if the client sends an invalid certificate (an empty certificate is considered valid).

            • honor_cipher_order
              TypeBoolean
              Defaulttrue
              Description

              An important security setting. It forces the cipher to be set based on the server-specified order instead of the client-specified order, hence enforcing the (usually more properly configured) security ordering of the server administrator.

            • client_renegotiation
              TypeBoolean
              Defaulttrue
              Description

              In protocols that support client-initiated renegotiation, the cost of resources of such an operation is higher for the server than the client. This can act as a vector for denial of service attacks. The SSL application already takes measures to counter-act such attempts, but client-initiated renegotiation can be strictly disabled by setting this option to false. The default value is true. Note that disabling renegotiation can result in long-lived connections becoming unusable due to limits on the number of messages the underlying cipher suite can encipher.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • handshake_timeout
              TypeDuration
              Default"15s"
              Description

              Maximum time duration allowed for the handshake to complete
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • gc_after_handshake
              TypeBoolean
              Defaultfalse
              Description

              Memory usage tuning. If enabled, will immediately perform a garbage collection after the TLS/SSL handshake.

            • ocsp
              TypeStruct(ocsp)

              ocsp

              • enable_ocsp_stapling
                TypeBoolean
                Defaultfalse
                Description

                Whether to enable Online Certificate Status Protocol (OCSP) stapling for the listener. If set to true, requires defining the OCSP responder URL and issuer PEM path.

              • responder_url
                TypeString
                Description

                URL for the OCSP responder to check the server certificate against.

              • issuer_pem
                TypeString
                Description

                PEM-encoded certificate of the OCSP issuer for the server certificate.

              • refresh_interval
                TypeDuration
                Default"5m"
                Description

                The period to refresh the OCSP response for the server.
                A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

              • refresh_http_timeout
                TypeDuration
                Default"15s"
                Description

                The timeout for the HTTP request when checking OCSP responses.
                A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • enable_crl_check
              TypeBoolean
              Defaultfalse
              Description

              Whether to enable CRL verification for this listener.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Whether to enable this gateway

      • enable_stats

        TypeBoolean
        Defaulttrue
        Description

        Whether to enable client process statistic

      • idle_timeout

        TypeDuration
        Default"30s"
        Description

        The idle time of the client connection process. It has two purposes:

        1. A newly created client process that does not receive any client requests after that time will be closed directly.
        2. A running client process that does not receive any client requests after this time will go into hibernation to save resources.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.
      • clientinfo_override

        TypeStruct(clientinfo_override)
        Description

        ClientInfo override.

        clientinfo_override

        • username
          TypeString
          Description

          Template for overriding username.

        • password
          TypeString
          Description

          Template for overriding password.

        • clientid
          TypeString
          Description

          Template for overriding clientid.

    • mqttsn

      TypeStruct(mqttsn)

      mqttsn

      • gateway_id

        TypeInteger
        Default1
        Description

        MQTT-SN Gateway ID. When the broadcast option is enabled, the gateway will broadcast ADVERTISE message with this value

      • broadcast

        TypeBoolean
        Defaultfalse
        Description

        Whether to periodically broadcast ADVERTISE messages

      • enable_qos3

        TypeBoolean
        Defaulttrue
        Description

        Allows connectionless clients to publish messages with a Qos of -1. This feature is defined for very simple client implementations which do not support any other features except this one. There is no connection setup nor tear down, no registration nor subscription. The client just sends its 'PUBLISH' messages to a GW

      • subs_resume

        TypeBoolean
        Defaultfalse
        Description

        Whether to initiate all subscribed topic name registration messages to the client after the Session has been taken over by a new channel

      • predefined

        TypeArray(Struct(mqttsn_predefined))
        Default[]
        Description

        The pre-defined topic IDs and topic names. A 'pre-defined' topic ID is a topic ID whose mapping to a topic name is known in advance by both the client's application and the gateway

        mqttsn_predefined

        • id
          TypeInteger(1..1024)
          Description

          Topic ID. Range: 1-65535

        • topic
          TypeString
          Description

          Topic Name

      • mountpoint

        TypeString
        Default""
        Description

        When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

        • ${clientid}: clientid
        • ${username}: username
        • ${endpoint_name}: endpoint name
      • listeners

        TypeStruct(udp_listeners)

        udp_listeners

        • udp
          TypeMap($name->Struct(udp_listener))
          Description

          A map from listener names to listener settings.

          udp_listener

          • udp_options
            TypeStruct(udp_opts)

            udp_opts

            • active_n
              TypeInteger
              Default100
              Description

              Specify the {active, N} option for the socket. See: https://erlang.org/doc/man/inet.html#setopts-2

            • recbuf
              TypeBytesize
              Description

              Size of the kernel-space receive buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • sndbuf
              TypeBytesize
              Description

              Size of the kernel-space send buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • buffer
              TypeBytesize
              Description

              Size of the user-space buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • reuseaddr
              TypeBoolean
              Defaulttrue
              Description

              Allow local reuse of port numbers.

          • enable
            TypeBoolean
            Defaulttrue
            Description

            Enable the listener.

          • bind
            TypeString
            Description

            The IP address and port that the listener will bind.

          • max_connections
            TypeOneOf(Integer(1..+inf),String("infinity"))
            Default1024
            Description

            Maximum number of concurrent connections.

          • max_conn_rate
            TypeInteger
            Default1000
            Description

            Maximum connections per second.

          • enable_authn
            TypeBoolean
            Defaulttrue
            Description

            Set true (default) to enable client authentication on this listener. When set to false clients will be allowed to connect without authentication.

          • mountpoint
            TypeString
            Description

            When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

            • ${clientid}: clientid
            • ${username}: username
            • ${endpoint_name}: endpoint name
          • access_rules
            TypeArray(String)
            Default[]
            Description

            The access control rules for this listener. See: https://github.com/emqtt/esockd#allowdeny

        • dtls
          TypeMap($name->Struct(dtls_listener))
          Description

          A map from listener names to listener settings.

          dtls_listener

          • acceptors
            TypeInteger
            Default16
            Description

            Size of the acceptor pool.

          • udp_options
            TypeStruct(udp_opts)

            udp_opts

            • active_n
              TypeInteger
              Default100
              Description

              Specify the {active, N} option for the socket. See: https://erlang.org/doc/man/inet.html#setopts-2

            • recbuf
              TypeBytesize
              Description

              Size of the kernel-space receive buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • sndbuf
              TypeBytesize
              Description

              Size of the kernel-space send buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • buffer
              TypeBytesize
              Description

              Size of the user-space buffer for the socket.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • reuseaddr
              TypeBoolean
              Defaulttrue
              Description

              Allow local reuse of port numbers.

          • enable
            TypeBoolean
            Defaulttrue
            Description

            Enable the listener.

          • bind
            TypeString
            Description

            The IP address and port that the listener will bind.

          • max_connections
            TypeOneOf(Integer(1..+inf),String("infinity"))
            Default1024
            Description

            Maximum number of concurrent connections.

          • max_conn_rate
            TypeInteger
            Default1000
            Description

            Maximum connections per second.

          • enable_authn
            TypeBoolean
            Defaulttrue
            Description

            Set true (default) to enable client authentication on this listener. When set to false clients will be allowed to connect without authentication.

          • mountpoint
            TypeString
            Description

            When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

            • ${clientid}: clientid
            • ${username}: username
            • ${endpoint_name}: endpoint name
          • access_rules
            TypeArray(String)
            Default[]
            Description

            The access control rules for this listener. See: https://github.com/emqtt/esockd#allowdeny

          • dtls_options
            TypeStruct(dtls_opts)
            Description

            DTLS socket options

            dtls_opts

            • cacertfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/cacert.pem"
              Description

              Trusted PEM format CA certificates bundle file.
              The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
              NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

            • cacerts
              TypeBoolean
              Description

              Deprecated since 5.1.4.

            • certfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/cert.pem"
              Description

              PEM format certificates chain file.
              The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

            • keyfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/key.pem"
              Description

              PEM format private key file.

            • verify
              TypeEnum(verify_peer,verify_none)
              Defaultverify_none
              Description

              Enable or disable peer verification.

            • reuse_sessions
              TypeBoolean
              Defaulttrue
              Description

              Enable TLS session reuse.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • depth
              TypeInteger(0..+inf)
              Default10
              Description

              Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
              if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
              if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

            • password
              TypeString
              Description

              String containing the user's password. Only used if the private key file is password-protected.

            • versions
              TypeArray(String)
              Default["dtlsv1.2"]
              Description

              All TLS/DTLS versions to be supported.
              NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
              In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

            • ciphers
              TypeArray(String)
              Default[]
              Description

              This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
              Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

              The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

              NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

              NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
              If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
              PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

            • secure_renegotiate
              TypeBoolean
              Defaulttrue
              Description

              SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • log_level
              TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
              Defaultnotice
              Description

              Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

            • hibernate_after
              TypeDuration
              Default"5s"
              Description

              Hibernate the SSL process after idling for amount of time reducing its memory footprint.
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • dhfile
              TypeString
              Description

              Path to a file containing PEM-encoded Diffie-Hellman parameters to be used by the server if a cipher suite using Diffie-Hellman key exchange is negotiated. If not specified, default parameters are used.
              NOTE: The dhfile option is not supported by TLS 1.3.

            • fail_if_no_peer_cert
              TypeBoolean
              Defaultfalse
              Description

              Used together with {verify, verify_peer} by an TLS/DTLS server. If set to true, the server fails if the client does not have a certificate to send, that is, sends an empty certificate. If set to false, it fails only if the client sends an invalid certificate (an empty certificate is considered valid).

            • honor_cipher_order
              TypeBoolean
              Defaulttrue
              Description

              An important security setting. It forces the cipher to be set based on the server-specified order instead of the client-specified order, hence enforcing the (usually more properly configured) security ordering of the server administrator.

            • client_renegotiation
              TypeBoolean
              Defaulttrue
              Description

              In protocols that support client-initiated renegotiation, the cost of resources of such an operation is higher for the server than the client. This can act as a vector for denial of service attacks. The SSL application already takes measures to counter-act such attempts, but client-initiated renegotiation can be strictly disabled by setting this option to false. The default value is true. Note that disabling renegotiation can result in long-lived connections becoming unusable due to limits on the number of messages the underlying cipher suite can encipher.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • handshake_timeout
              TypeDuration
              Default"15s"
              Description

              Maximum time duration allowed for the handshake to complete
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • gc_after_handshake
              TypeBoolean
              Defaultfalse
              Description

              Memory usage tuning. If enabled, will immediately perform a garbage collection after the TLS/SSL handshake.

            • ocsp
              TypeStruct(ocsp)

              ocsp

              • enable_ocsp_stapling
                TypeBoolean
                Defaultfalse
                Description

                Whether to enable Online Certificate Status Protocol (OCSP) stapling for the listener. If set to true, requires defining the OCSP responder URL and issuer PEM path.

              • responder_url
                TypeString
                Description

                URL for the OCSP responder to check the server certificate against.

              • issuer_pem
                TypeString
                Description

                PEM-encoded certificate of the OCSP issuer for the server certificate.

              • refresh_interval
                TypeDuration
                Default"5m"
                Description

                The period to refresh the OCSP response for the server.
                A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

              • refresh_http_timeout
                TypeDuration
                Default"15s"
                Description

                The timeout for the HTTP request when checking OCSP responses.
                A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • enable_crl_check
              TypeBoolean
              Defaultfalse
              Description

              Whether to enable CRL verification for this listener.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Whether to enable this gateway

      • enable_stats

        TypeBoolean
        Defaulttrue
        Description

        Whether to enable client process statistic

      • idle_timeout

        TypeDuration
        Default"30s"
        Description

        The idle time of the client connection process. It has two purposes:

        1. A newly created client process that does not receive any client requests after that time will be closed directly.
        2. A running client process that does not receive any client requests after this time will go into hibernation to save resources.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.
      • clientinfo_override

        TypeStruct(clientinfo_override)
        Description

        ClientInfo override.

        clientinfo_override

        • username
          TypeString
          Description

          Template for overriding username.

        • password
          TypeString
          Description

          Template for overriding password.

        • clientid
          TypeString
          Description

          Template for overriding clientid.

    • stomp

      TypeStruct(stomp)

      stomp

      • frame

        TypeStruct(stomp_frame)

        stomp_frame

        • max_headers
          TypeInteger(0..+inf)
          Default10
          Description

          The maximum number of Header

        • max_headers_length
          TypeInteger(0..+inf)
          Default1024
          Description

          The maximum string length of the Header Value

        • max_body_length
          TypeInteger
          Default65536
          Description

          Maximum number of bytes of Body allowed per Stomp packet

      • mountpoint

        TypeString
        Default""
        Description

        When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

        • ${clientid}: clientid
        • ${username}: username
        • ${endpoint_name}: endpoint name
      • listeners

        TypeStruct(tcp_listeners)

        tcp_listeners

        • tcp
          TypeMap($name->Struct(tcp_listener))
          Description

          A map from listener names to listener settings.

          tcp_listener

          • acceptors
            TypeInteger
            Default16
            Description

            Size of the acceptor pool.

          • tcp_options
            TypeStruct(tcp_opts)
            Description

            Setting the TCP socket options.

            tcp_opts

            • active_n
              TypeInteger
              Default100
              Description

              Specify the {active, N} option for this Socket.
              See: https://erlang.org/doc/man/inet.html#setopts-2

            • backlog
              TypeInteger(1..+inf)
              Default1024
              Description

              TCP backlog defines the maximum length that the queue of pending connections can grow to.

            • send_timeout
              TypeDuration
              Default"15s"
              Description

              The TCP send timeout for the connections.
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • send_timeout_close
              TypeBoolean
              Defaulttrue
              Description

              Close the connection if send timeout.

            • recbuf
              TypeBytesize
              Description

              The TCP receive buffer (OS kernel) for the connections.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • sndbuf
              TypeBytesize
              Description

              The TCP send buffer (OS kernel) for the connections.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • buffer
              TypeBytesize
              Default"4KB"
              Description

              The size of the user-space buffer used by the driver.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • high_watermark
              TypeBytesize
              Default"1MB"
              Description

              The socket is set to a busy state when the amount of data queued internally by the VM socket implementation reaches this limit.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • nodelay
              TypeBoolean
              Defaulttrue
              Description

              The TCP_NODELAY flag for the connections.

            • reuseaddr
              TypeBoolean
              Defaulttrue
              Description

              The SO_REUSEADDR flag for the connections.

            • keepalive
              TypeString
              Defaultnone
              Description

              Enable TCP keepalive for MQTT connections over TCP or SSL. The value is three comma separated numbers in the format of 'Idle,Interval,Probes'

              • Idle: The number of seconds a connection needs to be idle before the server begins to send out keep-alive probes (Linux default 7200).
              • Interval: The number of seconds between TCP keep-alive probes (Linux default 75).
              • Probes: The maximum number of TCP keep-alive probes to send before giving up and killing the connection if no response is obtained from the other end (Linux default 9). For example "240,30,5" means: EMQX should start sending TCP keepalive probes after the connection is in idle for 240 seconds, and the probes are sent every 30 seconds until a response is received from the MQTT client, if it misses 5 consecutive responses, EMQX should close the connection. Default: 'none'
          • proxy_protocol
            TypeBoolean
            Defaultfalse
            Description

            Enable the Proxy Protocol V1/2 if the EMQX cluster is deployed behind HAProxy or Nginx. See: https://www.haproxy.com/blog/haproxy/proxy-protocol/

          • proxy_protocol_timeout
            TypeDuration
            Default"3s"
            Description

            Timeout for proxy protocol. EMQX will close the TCP connection if proxy protocol packet is not received within the timeout.
            A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

          • enable
            TypeBoolean
            Defaulttrue
            Description

            Enable the listener.

          • bind
            TypeString
            Description

            The IP address and port that the listener will bind.

          • max_connections
            TypeOneOf(Integer(1..+inf),String("infinity"))
            Default1024
            Description

            Maximum number of concurrent connections.

          • max_conn_rate
            TypeInteger
            Default1000
            Description

            Maximum connections per second.

          • enable_authn
            TypeBoolean
            Defaulttrue
            Description

            Set true (default) to enable client authentication on this listener. When set to false clients will be allowed to connect without authentication.

          • mountpoint
            TypeString
            Description

            When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

            • ${clientid}: clientid
            • ${username}: username
            • ${endpoint_name}: endpoint name
          • access_rules
            TypeArray(String)
            Default[]
            Description

            The access control rules for this listener. See: https://github.com/emqtt/esockd#allowdeny

        • ssl
          TypeMap($name->Struct(ssl_listener))
          Description

          A map from listener names to listener settings.

          ssl_listener

          • acceptors
            TypeInteger
            Default16
            Description

            Size of the acceptor pool.

          • tcp_options
            TypeStruct(tcp_opts)
            Description

            Setting the TCP socket options.

            tcp_opts

            • active_n
              TypeInteger
              Default100
              Description

              Specify the {active, N} option for this Socket.
              See: https://erlang.org/doc/man/inet.html#setopts-2

            • backlog
              TypeInteger(1..+inf)
              Default1024
              Description

              TCP backlog defines the maximum length that the queue of pending connections can grow to.

            • send_timeout
              TypeDuration
              Default"15s"
              Description

              The TCP send timeout for the connections.
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • send_timeout_close
              TypeBoolean
              Defaulttrue
              Description

              Close the connection if send timeout.

            • recbuf
              TypeBytesize
              Description

              The TCP receive buffer (OS kernel) for the connections.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • sndbuf
              TypeBytesize
              Description

              The TCP send buffer (OS kernel) for the connections.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • buffer
              TypeBytesize
              Default"4KB"
              Description

              The size of the user-space buffer used by the driver.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • high_watermark
              TypeBytesize
              Default"1MB"
              Description

              The socket is set to a busy state when the amount of data queued internally by the VM socket implementation reaches this limit.
              A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

            • nodelay
              TypeBoolean
              Defaulttrue
              Description

              The TCP_NODELAY flag for the connections.

            • reuseaddr
              TypeBoolean
              Defaulttrue
              Description

              The SO_REUSEADDR flag for the connections.

            • keepalive
              TypeString
              Defaultnone
              Description

              Enable TCP keepalive for MQTT connections over TCP or SSL. The value is three comma separated numbers in the format of 'Idle,Interval,Probes'

              • Idle: The number of seconds a connection needs to be idle before the server begins to send out keep-alive probes (Linux default 7200).
              • Interval: The number of seconds between TCP keep-alive probes (Linux default 75).
              • Probes: The maximum number of TCP keep-alive probes to send before giving up and killing the connection if no response is obtained from the other end (Linux default 9). For example "240,30,5" means: EMQX should start sending TCP keepalive probes after the connection is in idle for 240 seconds, and the probes are sent every 30 seconds until a response is received from the MQTT client, if it misses 5 consecutive responses, EMQX should close the connection. Default: 'none'
          • proxy_protocol
            TypeBoolean
            Defaultfalse
            Description

            Enable the Proxy Protocol V1/2 if the EMQX cluster is deployed behind HAProxy or Nginx. See: https://www.haproxy.com/blog/haproxy/proxy-protocol/

          • proxy_protocol_timeout
            TypeDuration
            Default"3s"
            Description

            Timeout for proxy protocol. EMQX will close the TCP connection if proxy protocol packet is not received within the timeout.
            A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

          • enable
            TypeBoolean
            Defaulttrue
            Description

            Enable the listener.

          • bind
            TypeString
            Description

            The IP address and port that the listener will bind.

          • max_connections
            TypeOneOf(Integer(1..+inf),String("infinity"))
            Default1024
            Description

            Maximum number of concurrent connections.

          • max_conn_rate
            TypeInteger
            Default1000
            Description

            Maximum connections per second.

          • enable_authn
            TypeBoolean
            Defaulttrue
            Description

            Set true (default) to enable client authentication on this listener. When set to false clients will be allowed to connect without authentication.

          • mountpoint
            TypeString
            Description

            When publishing or subscribing, prefix all topics with a mountpoint string. The prefixed string will be removed from the topic name when the message is delivered to the subscriber. The mountpoint is a way that users can use to implement isolation of message routing between different listeners. For example if a client A subscribes to t with listeners.tcp.\<name>.mountpoint set to some_tenant, then the client actually subscribes to the topic some_tenant/t. Similarly, if another client B (connected to the same listener as the client A) sends a message to topic t, the message is routed to all the clients subscribed some_tenant/t, so client A will receive the message, with topic name t. Set to "" to disable the feature. Supported placeholders in mountpoint string:

            • ${clientid}: clientid
            • ${username}: username
            • ${endpoint_name}: endpoint name
          • access_rules
            TypeArray(String)
            Default[]
            Description

            The access control rules for this listener. See: https://github.com/emqtt/esockd#allowdeny

          • ssl_options
            TypeStruct(listener_ssl_opts)
            Description

            SSL Socket options.

            listener_ssl_opts

            • cacertfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/cacert.pem"
              Description

              Trusted PEM format CA certificates bundle file.
              The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
              NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

            • cacerts
              TypeBoolean
              Description

              Deprecated since 5.1.4.

            • certfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/cert.pem"
              Description

              PEM format certificates chain file.
              The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

            • keyfile
              TypeString
              Default"${EMQX_ETC_DIR}/certs/key.pem"
              Description

              PEM format private key file.

            • verify
              TypeEnum(verify_peer,verify_none)
              Defaultverify_none
              Description

              Enable or disable peer verification.

            • reuse_sessions
              TypeBoolean
              Defaulttrue
              Description

              Enable TLS session reuse.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • depth
              TypeInteger(0..+inf)
              Default10
              Description

              Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
              if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
              if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

            • password
              TypeString
              Description

              String containing the user's password. Only used if the private key file is password-protected.

            • versions
              TypeArray(String)
              Default["tlsv1.3", "tlsv1.2"]
              Description

              All TLS/DTLS versions to be supported.
              NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
              In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

            • ciphers
              TypeArray(String)
              Default[]
              Description

              This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
              Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

              The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

              NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

              NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
              If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
              PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

            • secure_renegotiate
              TypeBoolean
              Defaulttrue
              Description

              SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • log_level
              TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
              Defaultnotice
              Description

              Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

            • hibernate_after
              TypeDuration
              Default"5s"
              Description

              Hibernate the SSL process after idling for amount of time reducing its memory footprint.
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • dhfile
              TypeString
              Description

              Path to a file containing PEM-encoded Diffie-Hellman parameters to be used by the server if a cipher suite using Diffie-Hellman key exchange is negotiated. If not specified, default parameters are used.
              NOTE: The dhfile option is not supported by TLS 1.3.

            • fail_if_no_peer_cert
              TypeBoolean
              Defaultfalse
              Description

              Used together with {verify, verify_peer} by an TLS/DTLS server. If set to true, the server fails if the client does not have a certificate to send, that is, sends an empty certificate. If set to false, it fails only if the client sends an invalid certificate (an empty certificate is considered valid).

            • honor_cipher_order
              TypeBoolean
              Defaulttrue
              Description

              An important security setting. It forces the cipher to be set based on the server-specified order instead of the client-specified order, hence enforcing the (usually more properly configured) security ordering of the server administrator.

            • client_renegotiation
              TypeBoolean
              Defaulttrue
              Description

              In protocols that support client-initiated renegotiation, the cost of resources of such an operation is higher for the server than the client. This can act as a vector for denial of service attacks. The SSL application already takes measures to counter-act such attempts, but client-initiated renegotiation can be strictly disabled by setting this option to false. The default value is true. Note that disabling renegotiation can result in long-lived connections becoming unusable due to limits on the number of messages the underlying cipher suite can encipher.
              Has no effect when TLS version is configured (or negotiated) to 1.3

            • handshake_timeout
              TypeDuration
              Default"15s"
              Description

              Maximum time duration allowed for the handshake to complete
              A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • gc_after_handshake
              TypeBoolean
              Defaultfalse
              Description

              Memory usage tuning. If enabled, will immediately perform a garbage collection after the TLS/SSL handshake.

            • ocsp
              TypeStruct(ocsp)

              ocsp

              • enable_ocsp_stapling
                TypeBoolean
                Defaultfalse
                Description

                Whether to enable Online Certificate Status Protocol (OCSP) stapling for the listener. If set to true, requires defining the OCSP responder URL and issuer PEM path.

              • responder_url
                TypeString
                Description

                URL for the OCSP responder to check the server certificate against.

              • issuer_pem
                TypeString
                Description

                PEM-encoded certificate of the OCSP issuer for the server certificate.

              • refresh_interval
                TypeDuration
                Default"5m"
                Description

                The period to refresh the OCSP response for the server.
                A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

              • refresh_http_timeout
                TypeDuration
                Default"15s"
                Description

                The timeout for the HTTP request when checking OCSP responses.
                A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

            • enable_crl_check
              TypeBoolean
              Defaultfalse
              Description

              Whether to enable CRL verification for this listener.

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Whether to enable this gateway

      • enable_stats

        TypeBoolean
        Defaulttrue
        Description

        Whether to enable client process statistic

      • idle_timeout

        TypeDuration
        Default"30s"
        Description

        The idle time of the client connection process. It has two purposes:

        1. A newly created client process that does not receive any client requests after that time will be closed directly.
        2. A running client process that does not receive any client requests after this time will go into hibernation to save resources.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.
      • clientinfo_override

        TypeStruct(clientinfo_override)
        Description

        ClientInfo override.

        clientinfo_override

        • username
          TypeString
          Description

          Template for overriding username.

        • password
          TypeString
          Description

          Template for overriding password.

        • clientid
          TypeString
          Description

          Template for overriding clientid.

  • prometheus

    TypeOneOf(Struct(recommend_setting),Struct(legacy_deprecated_setting))
    Default{}

    recommend_setting

    • enable_basic_auth

      TypeBoolean
      Defaultfalse
      Description

      Enable or disable basic authentication for prometheus scrape api, not for Push Gateway

    • push_gateway

      TypeStruct(push_gateway)
      Description

      Push Gateway is optional, should not be configured if prometheus is to scrape EMQX.

      push_gateway

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable or disable Pushgateway

      • url

        TypeString
        Default"http://127.0.0.1:9091"
        Description

        URL of Pushgateway server. Pushgateway is optional, should not be configured if prometheus is to scrape EMQX.

      • interval

        TypeDuration
        Default"15s"
        Description

        Data reporting interval
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • headers

        TypeMap
        Default{}
        Description

        An HTTP Headers when pushing to Push Gateway.
        For example, { Authorization = "some-authz-tokens"}

      • job_name

        TypeString
        Default"${name}/instance/${name}~${host}"
        Description

        Job Name that is pushed to the Push Gateway. Available variables:

        • ${name}: Name of EMQX node.
        • ${host}: Host name of EMQX node.
          For example, when the EMQX node name is emqx@127.0.0.1 then the name variable takes value emqx and the host variable takes value 127.0.0.1. Default value is: ${name}/instance/${name}~${host}
    • collectors

      TypeStruct(collectors)
      Description

      The internal advanced metrics of the virtual machine are initially disabled and are usually only enabled during performance testing. Enabling them will increase the CPU load.

      collectors

      • vm_dist

        TypeEnum(disabled,enabled)
        Defaultdisabled
        Description

        Enable or disable VM distribution collector, collects information about the sockets and processes involved in the Erlang distribution mechanism.

      • mnesia

        TypeEnum(enabled,disabled)
        Defaultdisabled
        Description

        Collects Mnesia metrics mainly using mnesia:system_info/1

      • vm_statistics

        TypeEnum(enabled,disabled)
        Defaultdisabled
        Description

        Enable or disable VM statistics collector.

      • vm_system_info

        TypeEnum(enabled,disabled)
        Defaultdisabled
        Description

        Enable or disable VM system info collector.

      • vm_memory

        TypeEnum(enabled,disabled)
        Defaultdisabled
        Description

        Collects information about memory dynamically allocated by the Erlang emulator using erlang:memory/0 .

      • vm_msacc

        TypeEnum(enabled,disabled)
        Defaultdisabled
        Description

        Enable or disable VM microstate accounting metrics collector.

    legacy_deprecated_setting

    • push_gateway_server

      TypeString
      Default"http://127.0.0.1:9091"
      Description

      Deprecated since 5.4.0, use prometheus.push_gateway.url instead

    • interval

      TypeDuration
      Default"15s"
      Description

      Deprecated since 5.4.0, use prometheus.push_gateway.interval instead
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • headers

      TypeMap
      Default{}
      Description

      Deprecated since 5.4.0, use prometheus.push_gateway.headers instead

    • job_name

      TypeString
      Default"${name}/instance/${name}~${host}"
      Description

      Deprecated since 5.4.0, use prometheus.push_gateway.job_name instead

    • enable

      TypeBoolean
      Defaultfalse
      Description

      Deprecated since 5.4.0, use prometheus.push_gateway.url instead

    • vm_dist_collector

      TypeEnum(disabled,enabled)
      Defaultdisabled
      Description

      Deprecated since 5.4.0, use prometheus.collectors.vm_dist instead

    • mnesia_collector

      TypeEnum(enabled,disabled)
      Defaultdisabled
      Description

      Deprecated since 5.4.0, use prometheus.collectors.mnesia instead

    • vm_statistics_collector

      TypeEnum(enabled,disabled)
      Defaultdisabled
      Description

      Deprecated since 5.4.0, use prometheus.collectors.vm_statistics instead

    • vm_system_info_collector

      TypeEnum(enabled,disabled)
      Defaultdisabled
      Description

      Deprecated, use prometheus.collectors.vm_system_info instead

    • vm_memory_collector

      TypeEnum(enabled,disabled)
      Defaultdisabled
      Description

      Deprecated since 5.4.0, use prometheus.collectors.vm_memory instead

    • vm_msacc_collector

      TypeEnum(enabled,disabled)
      Defaultdisabled
      Description

      Deprecated since 5.4.0, use prometheus.collectors.vm_msacc instead

  • exhook

    TypeStruct(exhook)

    exhook

    • servers

      TypeArray(Struct(server))
      Default[]
      Description

      List of exhook servers

      server

      • name

        TypeString
        Description

        Name of the exhook server

      • enable

        TypeBoolean
        Defaulttrue
        Description

        Enable this Exhook server

      • url

        TypeString
        Description

        URL of the gRPC server

      • request_timeout

        TypeDuration
        Default"5s"
        Description

        The timeout of request gRPC server
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • failed_action

        TypeEnum(deny,ignore)
        Defaultdeny
        Description

        The value that is returned when the request to the gRPC server fails for any reason

      • ssl

        TypeStruct(ssl_conf)

        ssl_conf

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

      • socket_options

        TypeStruct(socket_options)
        Default{keepalive = true, nodelay = true}

        socket_options

        • keepalive
          TypeBoolean
          Defaulttrue
          Description

          Enables/disables periodic transmission on a connected socket when no other data is exchanged. If the other end does not respond, the connection is considered broken and an error message is sent to the controlling process.

        • nodelay
          TypeBoolean
          Defaulttrue
          Description

          If true, option TCP_NODELAY is turned on for the socket, which means that also small amounts of data are sent immediately

        • recbuf
          TypeBytesize
          Description

          The minimum size of receive buffer to use for the socket
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

        • sndbuf
          TypeBytesize
          Description

          The minimum size of send buffer to use for the socket
          A string that represents a number of bytes, for example: 10B, 640kb, 4MB, 1GB. Units are interpreted as powers of 1024, and the unit part is case-insensitive.

      • auto_reconnect

        TypeOneOf(String("false"),Duration)
        Default"60s"
        Description

        Whether to automatically reconnect (initialize) the gRPC server. When gRPC is not available, Exhook tries to request the gRPC service at that interval and reinitialize the list of mounted hooks.

      • pool_size

        TypeInteger(1..+inf)
        Default8
        Description

        The process pool size for gRPC client

  • psk_authentication

    TypeStruct(psk_authentication)

    psk_authentication

    • enable

      TypeBoolean
      Defaultfalse
      Description

      Whether to enable TLS PSK support

    • init_file

      TypeString
      Description

      If init_file is specified, EMQX will import PSKs from the file into the built-in database at startup for use by the runtime. The file has to be structured line-by-line, each line must be in the format of PSKIdentity:SharedSecret. For example: mydevice1:c2VjcmV0

    • separator

      TypeString
      Default":"
      Description

      The separator between PSKIdentity and SharedSecret in the PSK file

    • chunk_size

      TypeInteger
      Default50
      Description

      The size of each chunk used to import to the built-in database from PSK file

  • slow_subs

    TypeStruct(slow_subs)

    slow_subs

    • enable

      TypeBoolean
      Defaultfalse
      Description

      Enable this feature

    • threshold

      TypeDuration
      Default"500ms"
      Description

      The latency threshold for statistics
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • expire_interval

      TypeDuration
      Default"300s"
      Description

      The eviction time of the record, which in the statistics record table
      A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • top_k_num

      TypeInteger(1..+inf)
      Default10
      Description

      The maximum number of records in the slow subscription statistics record table

    • stats_type

      TypeEnum(whole,internal,response)
      Defaultwhole
      Description

      The method to calculate the latency

  • opentelemetry

    TypeStruct(opentelemetry)

    opentelemetry

    • metrics

      TypeStruct(otel_metrics)
      Description

      Open Telemetry Metrics configuration.

      otel_metrics

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable or disable Open Telemetry signal.

      • interval

        Aliasesscheduled_delay
        TypeDuration
        Default"10s"
        Description

        The delay interval between two consecutive exports of Open Telemetry signals.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • logs

      TypeStruct(otel_logs)
      Description

      Open Telemetry Logs configuration. If enabled, EMQX installs a log handler that formats events according to Open Telemetry log data model and exports them to the configured Open Telemetry collector or backend.

      otel_logs

      • level

        TypeEnum(debug,info,notice,warning,error,critical,alert,emergency,all)
        Defaultwarning
        Description

        The log level of the Open Telemetry log handler.

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable or disable Open Telemetry signal.

      • scheduled_delay

        TypeDuration
        Default"1s"
        Description

        The delay interval between two consecutive exports of Open Telemetry signals.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

    • traces

      TypeStruct(otel_traces)
      Description

      Open Telemetry Traces configuration.

      otel_traces

      • enable

        TypeBoolean
        Defaultfalse
        Description

        Enable or disable Open Telemetry signal.

      • scheduled_delay

        TypeDuration
        Default"5s"
        Description

        The delay interval between two consecutive exports of Open Telemetry signals.
        A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

      • filter

        TypeStruct(trace_filter)
        Description

        Open Telemetry Trace Filter configuration

        trace_filter

        • trace_all
          TypeBoolean
          Defaultfalse
          Description

          If enabled, all published messages are traced, a new trace ID is generated if it can't be extracted from the message. Otherwise, only messages published with trace context are traced. Disabled by default.

    • exporter

      TypeStruct(otel_exporter)
      Description

      Open Telemetry Exporter

      otel_exporter

      • endpoint

        TypeString
        Default"http://localhost:4317"
        Description

        The target URL to which the exporter is going to send Open Telemetry signal data.

      • ssl_options

        TypeStruct(ssl_client_opts)
        Default{enable = false}
        Description

        SSL configuration for the Open Telemetry exporter

        ssl_client_opts

        • cacertfile
          TypeString
          Description

          Trusted PEM format CA certificates bundle file.
          The certificates in this file are used to verify the TLS peer's certificates. Append new certificates to the file if new CAs are to be trusted. There is no need to restart EMQX to have the updated file loaded, because the system regularly checks if file has been updated (and reload).
          NOTE: invalidating (deleting) a certificate from the file will not affect already established connections.

        • cacerts
          TypeBoolean
          Description

          Deprecated since 5.1.4.

        • certfile
          TypeString
          Description

          PEM format certificates chain file.
          The certificates in this file should be in reversed order of the certificate issue chain. That is, the host's certificate should be placed in the beginning of the file, followed by the immediate issuer certificate and so on. Although the root CA certificate is optional, it should be placed at the end of the file if it is to be added.

        • keyfile
          TypeString
          Description

          PEM format private key file.

        • verify
          TypeEnum(verify_peer,verify_none)
          Defaultverify_none
          Description

          Enable or disable peer verification.

        • reuse_sessions
          TypeBoolean
          Defaulttrue
          Description

          Enable TLS session reuse.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • depth
          TypeInteger(0..+inf)
          Default10
          Description

          Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path. So, if depth is 0 the PEER must be signed by the trusted ROOT-CA directly;
          if 1 the path can be PEER, Intermediate-CA, ROOT-CA;
          if 2 the path can be PEER, Intermediate-CA1, Intermediate-CA2, ROOT-CA.

        • password
          TypeString
          Description

          String containing the user's password. Only used if the private key file is password-protected.

        • versions
          TypeArray(String)
          Default["tlsv1.3", "tlsv1.2"]
          Description

          All TLS/DTLS versions to be supported.
          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config.
          In case PSK cipher suites are intended, make sure to configure ['tlsv1.2', 'tlsv1.1'] here.

        • ciphers
          TypeArray(String)
          Default[]
          Description

          This config holds TLS cipher suite names separated by comma, or as an array of strings. e.g. "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256" or ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"].
          Ciphers (and their ordering) define the way in which the client and server encrypts information over the network connection. Selecting a good cipher suite is critical for the application's data security, confidentiality and performance.

          The names should be in OpenSSL string format (not RFC format). All default values and examples provided by EMQX config documentation are all in OpenSSL format.

          NOTE: Certain cipher suites are only compatible with specific TLS versions ('tlsv1.1', 'tlsv1.2' or 'tlsv1.3') incompatible cipher suites will be silently dropped. For instance, if only 'tlsv1.3' is given in the versions, configuring cipher suites for other versions will have no effect.

          NOTE: PSK ciphers are suppressed by 'tlsv1.3' version config
          If PSK cipher suites are intended, 'tlsv1.3' should be disabled from versions.
          PSK cipher suites: "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384, RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256, RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA, RSA-PSK-DES-CBC3-SHA,RSA-PSK-RC4-SHA"

        • secure_renegotiate
          TypeBoolean
          Defaulttrue
          Description

          SSL parameter renegotiation is a feature that allows a client and a server to renegotiate the parameters of the SSL connection on the fly. RFC 5746 defines a more secure way of doing this. By enabling secure renegotiation, you drop support for the insecure renegotiation, prone to MitM attacks.
          Has no effect when TLS version is configured (or negotiated) to 1.3

        • log_level
          TypeEnum(emergency,alert,critical,error,warning,notice,info,debug,none,all)
          Defaultnotice
          Description

          Log level for SSL communication. Default is 'notice'. Set to 'debug' to inspect TLS handshake messages.

        • hibernate_after
          TypeDuration
          Default"5s"
          Description

          Hibernate the SSL process after idling for amount of time reducing its memory footprint.
          A string that represents a time duration, for example: 10s, 2.5m, 1h30m, 1W2D, or 2345ms, which is the smallest unit. When precision is specified, finer portions of the duration may be ignored: writing 1200ms for Duration(s) is equivalent to writing 1s. The unit part is case-insensitive.

        • enable
          TypeBoolean
          Defaultfalse
          Description

          Enable TLS.

        • server_name_indication
          TypeOneOf(String("disable"),String)
          Description

          Specify the host name to be used in TLS Server Name Indication extension.
          For instance, when connecting to "server.example.net", the genuine server which accepts the connection and performs TLS handshake may differ from the host the TLS client initially connects to, e.g. when connecting to an IP address or when the host has multiple resolvable DNS records
          If not specified, it will default to the host name string which is used to establish the connection, unless it is IP address used.
          The host name is then also used in the host name verification of the peer certificate.
          The special value 'disable' prevents the Server Name Indication extension from being sent and disables the hostname verification check.

  • api_key

    TypeStruct(api_key)

    api_key

    • bootstrap_file

      TypeString
      Default""
      Description

      The bootstrap file provides API keys for EMQX. EMQX will load these keys on startup to authorize API requests. It contains colon-separated values in the format: api_key:api_secret:role. Each line specifies an API key and its associated secret, and the role of this key. The 'role' part should be the pre-defined access scope group name, for example, administrator or viewer. The 'role' is introduced in 5.4, to be backward compatible, if it is missing, the key is implicitly granted administrator role.