Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Instance Property

clientCertificateVerification

Mutual TLS: how the server verifies the certificate a client presents.
var clientCertificateVerification: ClientCertificateVerification?

Discussion

nil, the default, means clients are never asked for a certificate. Set it to ask for one; a chain that verifies reaches handlers as peerCertificateChain.

var tls = ServerConfiguration.TLSConfiguration.pemFile(
    certificateChainPath: "server.pem", privateKeyPath: "server.key")
tls.clientCertificateVerification = .init(trust: .pemFile(path: "client-ca.pem"))
app.serverConfiguration.tlsConfiguration = tls

Independent of where the server’s own credentials come from: any of the sources below, including a CertificateReloader, can be paired with client verification.