init(context:serverHostname:customVerificationCallback:)

Construct a new NIOSSLClientHandler with the given context and a specific serverHostname.

NIOSSLClientHandler.swift:126
convenience init(context: NIOSSLContext, serverHostname: String?, customVerificationCallback: @escaping NIOSSLCustomVerificationCallback) throws

Parameters

context

The NIOSSLContext to use on this connection.

serverHostname

The hostname of the server we’re trying to connect to, if known. This will be used in the SNI extension, and used to validate the server certificate.

customVerificationCallback

A callback to use that will override NIOSSL’s normal verification logic.

If set, this callback is provided the certificates presented by the peer. NIOSSL will not have pre-processed them. The callback will not be used if the TLSConfiguration that was used to construct the NIOSSLContext has certificateVerification set to none.