Advanced TLS configuration

TLS server configuration

TLS certificates are obtained by modules called "certificate loaders". 'tls' directive arguments specify name of loader to use and arguments. Due to syntax limitations advanced configuration for loader should be specified using 'loader' directive, see below.

tls file cert.pem key.pem {
    protocols tls1.2 tls1.3
    curve X25519
    ciphers ...
}

tls {
    loader file cert.pem key.pem {
        # Options for loader go here.
    }
    protocols tls1.2 tls1.3
    curve X25519
    ciphers ...
}

Available certificate loaders

Advanced TLS configuration

Note: maddy uses secure defaults and TLS handshake is resistant to active downgrade attacks. There is no need to change anything in most cases.

Syntax:
protocols min_version max_version
protocols version
Default: tls1.0 tls1.3

Minimum/maximum accepted TLS version. If only one value is specified, it will be the only one usable version.

Valid values are: tls1.0, tls1.1, tls1.2, tls1.3

Syntax: ciphers ciphers...
Default: Go version-defined set of 'secure ciphers', ordered by hardware performance

List of supported cipher suites, in preference order. Not used with TLS 1.3.

Valid values:

Syntax: curve curves...
Default: defined by Go version

The elliptic curves that will be used in an ECDHE handshake, in preference order.

Valid values: p256, p384, p521, X25519.

TLS client configuration

tls_client directive allows to customize behavior of TLS client implementation, notably adjusting minimal and maximal TLS versions and allowed cipher suites, enabling TLS client authentication.

tls_client {
    protocols tls1.2 tls1.3
    ciphers ...
    curve X25519
    root_ca /etc/ssl/cert.pem

    cert /etc/ssl/private/maddy-client.pem
    key /etc/ssl/private/maddy-client.pem
}

Syntax:
protocols min_version max_version
protocols version
Default: tls1.0 tls1.3

Minimum/maximum accepted TLS version. If only one value is specified, it will be the only one usable version.

Valid values are: tls1.0, tls1.1, tls1.2, tls1.3

Syntax: ciphers ciphers...
Default: Go version-defined set of 'secure ciphers', ordered by hardware performance

List of supported cipher suites, in preference order. Not used with TLS 1.3.

See TLS server configuration for list of supported values.

Syntax: curve curves...
Default: defined by Go version

The elliptic curves that will be used in an ECDHE handshake, in preference order.

Valid values: p256, p384, p521, X25519.

Syntax: root_ca paths...
Default: system CA pool

List of files with PEM-encoded CA certificates to use when verifying server certificates.

Syntax:
cert cert_path
key key_path
Default: not specified

Present the specified certificate when server requests a client certificate. Files should use PEM format. Both directives should be specified.