NIOSSLClientTLSProvider

public struct NIOSSLClientTLSProvider<Bootstrap> : NIOClientTLSProvider where Bootstrap : NIOClientTCPBootstrapProtocol

A TLS provider to bootstrap TLS-enabled connections with NIOClientTCPBootstrap.

Example:

// TLS setup.
let configuration = TLSConfiguration.forClient()
let sslContext = try NIOSSLContext(configuration: configuration)

// Creating the "universal bootstrap" with the `NIOSSLClientTLSProvider`.
let tlsProvider = NIOSSLClientTLSProvider<ClientBootstrap>(context: sslContext, serverHostname: "example.com")
let bootstrap = NIOClientTCPBootstrap(ClientBootstrap(group: group), tls: tlsProvider)

// Bootstrapping a connection using the "universal bootstrapping mechanism"
let connection = bootstrap.enableTLS()
                     .connect(to: "example.com")
                     .wait()