sslContextCallback
SSL Context Callback to provide dynamic context based on server name
var sslContextCallback: NIOSSLContextCallback?SSL Context Callback to provide dynamic context based on server name
var sslContextCallback: NIOSSLContextCallback?s6NIOSSL16TLSConfigurationV18sslContextCallbackyAA27NIOSSLClientExtensionValuesV_7NIOCore16EventLoopPromiseVyAA34NIOSSLContextConfigurationOverrideVGtYbcSgvp What are these?2P5MIimport NIOSSLTLS for SwiftNIO.
struct TLSConfigurationManages configuration of TLS for SwiftNIO programs.
typealias NIOSSLContextCallback = (NIOSSLClientExtensionValues, EventLoopPromise<NIOSSLContextConfigurationOverride>) -> VoidA callback that can used to support multiple or dynamic TLS hosts.
var minimumTLSVersion: TLSVersionThe minimum TLS version to allow in negotiation. Defaults to tlsv1.
var maximumTLSVersion: TLSVersion?The maximum TLS version to allow in negotiation. If nil, there is no upper limit. Defaults to nil.
var certificateVerification: CertificateVerificationWhether to verify remote certificates.
var trustRoots: NIOSSLTrustRoots?The trust roots to use to validate certificates. This only needs to be provided if you intend to validate certificates.
var certificateChain: [NIOSSLCertificateSource]The certificates to offer during negotiation. If not present, no certificates will be offered.
var privateKey: NIOSSLPrivateKeySource?The private key associated with the leaf certificate.
var applicationProtocols: [String] { get set }The application protocols to use in the connection. Should be an ordered list of ASCII strings representing the ALPN identifiers of the protocols to negotiate. For clients, the protocols will be offered in the order given. For servers, the protocols will be matched against the client’s offered protocols in order.
var shutdownTimeout: TimeAmountThe amount of time to wait after initiating a shutdown before performing an unclean shutdown. Defaults to 5 seconds.
var keyLogCallback: NIOSSLKeyLogCallback?A callback that can be used to implement SSLKEYLOGFILE support.
var renegotiationSupport: NIORenegotiationSupportWhether renegotiation is supported.
static let clientDefault: TLSConfigurationA default TLS configuration for client use.
static func makeClientConfiguration() -> TLSConfiguration Creates a TLS configuration for use with client-side contexts.
static func makePreSharedKeyConfiguration() -> TLSConfiguration Create a TLS configuration for use with server-side or client-side contexts that uses Pre-Shared Keys for TLS 1.2 and below.
static func makeServerConfiguration(certificateChain: [NIOSSLCertificateSource], privateKey: NIOSSLPrivateKeySource) -> TLSConfiguration Create a TLS configuration for use with server-side contexts.
static func makeServerConfigurationWithMTLS(certificateChain: [NIOSSLCertificateSource], privateKey: NIOSSLPrivateKeySource, trustRoots: NIOSSLTrustRoots) -> TLSConfiguration Create a TLS configuration for use with server-side contexts that expect to validate a client certificate (often called mTLS).
var additionalTrustRoots: [NIOSSLAdditionalTrustRoots]Additional trust roots to use to validate certificates, used in addition to trustRoots.
var cipherSuiteValues: [NIOTLSCipher] { get set }Public property used to set the internal cipherSuites from NIOTLSCipher.
var cipherSuites: StringThe pre-TLS1.3 cipher suites supported by this handler. This uses the OpenSSL cipher string format. TLS 1.3 cipher suites cannot be configured.
var curves: [NIOTLSCurve]?TLS curves supported by this handler. Passing nil means that a built-in set of curves will be used.
var pskClientProvider: NIOPSKClientIdentityProvider? { get set }PSK Client Callback to get the key based on an optional hint and identity.
var pskHint: String?Optional PSK hint to be used during SSLContext create.
var pskServerProvider: NIOPSKServerIdentityProvider? { get set }PSK Server Callback to get the key based on an optional hint and identity.
var sendCANameList: BoolSend the CA names derived from the trustRoots for client authentication. This instructs the client which identities can be used by evaluating what CA the identity certificate was issued from.
var signingSignatureAlgorithms: [SignatureAlgorithm]?Allowed algorithms to sign signatures. Passing nil means that a built-in set of algorithms will be used.
var verifySignatureAlgorithms: [SignatureAlgorithm]?Allowed algorithms to verify signatures. Passing nil means that a built-in set of algorithms will be used.
func bestEffortEquals(_ comparing: TLSConfiguration) -> Bool Returns a best effort result of whether two TLSConfiguration objects are equal.
func bestEffortHash(into hasher: inout Hasher) Returns a best effort hash of this TLS configuration.
static func forClient(cipherSuites: String = defaultCipherSuites, minimumTLSVersion: TLSVersion = .tlsv1, maximumTLSVersion: TLSVersion? = nil, certificateVerification: CertificateVerification = .fullVerification, trustRoots: NIOSSLTrustRoots = .default, certificateChain: [NIOSSLCertificateSource] = [], privateKey: NIOSSLPrivateKeySource? = nil, applicationProtocols: [String] = [], shutdownTimeout: TimeAmount = .seconds(5), keyLogCallback: NIOSSLKeyLogCallback? = nil) -> TLSConfiguration Creates a TLS configuration for use with client-side contexts.
static func forClient(cipherSuites: String = defaultCipherSuites, minimumTLSVersion: TLSVersion = .tlsv1, maximumTLSVersion: TLSVersion? = nil, certificateVerification: CertificateVerification = .fullVerification, trustRoots: NIOSSLTrustRoots = .default, certificateChain: [NIOSSLCertificateSource] = [], privateKey: NIOSSLPrivateKeySource? = nil, applicationProtocols: [String] = [], shutdownTimeout: TimeAmount = .seconds(5), keyLogCallback: NIOSSLKeyLogCallback? = nil, renegotiationSupport: NIORenegotiationSupport) -> TLSConfiguration Creates a TLS configuration for use with client-side contexts.
static func forClient(cipherSuites: String = defaultCipherSuites, verifySignatureAlgorithms: [SignatureAlgorithm]? = nil, signingSignatureAlgorithms: [SignatureAlgorithm]? = nil, minimumTLSVersion: TLSVersion = .tlsv1, maximumTLSVersion: TLSVersion? = nil, certificateVerification: CertificateVerification = .fullVerification, trustRoots: NIOSSLTrustRoots = .default, certificateChain: [NIOSSLCertificateSource] = [], privateKey: NIOSSLPrivateKeySource? = nil, applicationProtocols: [String] = [], shutdownTimeout: TimeAmount = .seconds(5), keyLogCallback: NIOSSLKeyLogCallback? = nil, renegotiationSupport: NIORenegotiationSupport) -> TLSConfiguration Creates a TLS configuration for use with client-side contexts.
static func forClient(cipherSuites: String = defaultCipherSuites, verifySignatureAlgorithms: [SignatureAlgorithm]? = nil, signingSignatureAlgorithms: [SignatureAlgorithm]? = nil, minimumTLSVersion: TLSVersion = .tlsv1, maximumTLSVersion: TLSVersion? = nil, certificateVerification: CertificateVerification = .fullVerification, trustRoots: NIOSSLTrustRoots = .default, certificateChain: [NIOSSLCertificateSource] = [], privateKey: NIOSSLPrivateKeySource? = nil, applicationProtocols: [String] = [], shutdownTimeout: TimeAmount = .seconds(5), keyLogCallback: NIOSSLKeyLogCallback? = nil, renegotiationSupport: NIORenegotiationSupport = .none, additionalTrustRoots: [NIOSSLAdditionalTrustRoots]) -> TLSConfiguration Creates a TLS configuration for use with client-side contexts.
static func forClient(cipherSuites: [NIOTLSCipher], verifySignatureAlgorithms: [SignatureAlgorithm]? = nil, signingSignatureAlgorithms: [SignatureAlgorithm]? = nil, minimumTLSVersion: TLSVersion = .tlsv1, maximumTLSVersion: TLSVersion? = nil, certificateVerification: CertificateVerification = .fullVerification, trustRoots: NIOSSLTrustRoots = .default, certificateChain: [NIOSSLCertificateSource] = [], privateKey: NIOSSLPrivateKeySource? = nil, applicationProtocols: [String] = [], shutdownTimeout: TimeAmount = .seconds(5), keyLogCallback: NIOSSLKeyLogCallback? = nil, renegotiationSupport: NIORenegotiationSupport = .none, additionalTrustRoots: [NIOSSLAdditionalTrustRoots] = []) -> TLSConfiguration Creates a TLS configuration for use with client-side contexts. This allows setting the NIOTLSCipher property specifically.
static func forServer(certificateChain: [NIOSSLCertificateSource], privateKey: NIOSSLPrivateKeySource, cipherSuites: String = defaultCipherSuites, minimumTLSVersion: TLSVersion = .tlsv1, maximumTLSVersion: TLSVersion? = nil, certificateVerification: CertificateVerification = .none, trustRoots: NIOSSLTrustRoots = .default, applicationProtocols: [String] = [], shutdownTimeout: TimeAmount = .seconds(5), keyLogCallback: NIOSSLKeyLogCallback? = nil) -> TLSConfiguration Create a TLS configuration for use with server-side contexts.
static func forServer(certificateChain: [NIOSSLCertificateSource], privateKey: NIOSSLPrivateKeySource, cipherSuites: String = defaultCipherSuites, verifySignatureAlgorithms: [SignatureAlgorithm]? = nil, signingSignatureAlgorithms: [SignatureAlgorithm]? = nil, minimumTLSVersion: TLSVersion = .tlsv1, maximumTLSVersion: TLSVersion? = nil, certificateVerification: CertificateVerification = .none, trustRoots: NIOSSLTrustRoots = .default, applicationProtocols: [String] = [], shutdownTimeout: TimeAmount = .seconds(5), keyLogCallback: NIOSSLKeyLogCallback? = nil) -> TLSConfiguration Create a TLS configuration for use with server-side contexts.
static func forServer(certificateChain: [NIOSSLCertificateSource], privateKey: NIOSSLPrivateKeySource, cipherSuites: String = defaultCipherSuites, verifySignatureAlgorithms: [SignatureAlgorithm]? = nil, signingSignatureAlgorithms: [SignatureAlgorithm]? = nil, minimumTLSVersion: TLSVersion = .tlsv1, maximumTLSVersion: TLSVersion? = nil, certificateVerification: CertificateVerification = .none, trustRoots: NIOSSLTrustRoots = .default, applicationProtocols: [String] = [], shutdownTimeout: TimeAmount = .seconds(5), keyLogCallback: NIOSSLKeyLogCallback? = nil, additionalTrustRoots: [NIOSSLAdditionalTrustRoots]) -> TLSConfiguration Create a TLS configuration for use with server-side contexts.
static func forServer(certificateChain: [NIOSSLCertificateSource], privateKey: NIOSSLPrivateKeySource, cipherSuites: [NIOTLSCipher], verifySignatureAlgorithms: [SignatureAlgorithm]? = nil, signingSignatureAlgorithms: [SignatureAlgorithm]? = nil, minimumTLSVersion: TLSVersion = .tlsv1, maximumTLSVersion: TLSVersion? = nil, certificateVerification: CertificateVerification = .none, trustRoots: NIOSSLTrustRoots = .default, applicationProtocols: [String] = [], shutdownTimeout: TimeAmount = .seconds(5), keyLogCallback: NIOSSLKeyLogCallback? = nil, additionalTrustRoots: [NIOSSLAdditionalTrustRoots] = []) -> TLSConfiguration Create a TLS configuration for use with server-side contexts. This allows setting the NIOTLSCipher property specifically.
var pskClientCallback: NIOPSKClientIdentityCallback? { get set }PSK Client Callback to get the key based on hint and identity.
var pskServerCallback: NIOPSKServerIdentityCallback? { get set }