diff --git a/Sources/Hummingbird/Server/ChildRequestContext.swift b/Sources/Hummingbird/Server/ChildRequestContext.swift index a736618c..b1a0e557 100644 --- a/Sources/Hummingbird/Server/ChildRequestContext.swift +++ b/Sources/Hummingbird/Server/ChildRequestContext.swift @@ -32,8 +32,8 @@ public protocol ChildRequestContext: RequestContext where Source } extension ChildRequestContext { - /// ChildRequestContext can never to created from it Source `Never` so add preconditionFailure public init(source: Source) { + // ChildRequestContext can never be created from it's Source `Never` so add preconditionFailure preconditionFailure("Cannot reach this.") } } diff --git a/Sources/HummingbirdHTTP2/HTTP2UpgradeChannel.swift b/Sources/HummingbirdHTTP2/HTTP2UpgradeChannel.swift index adefb6fa..976ca697 100644 --- a/Sources/HummingbirdHTTP2/HTTP2UpgradeChannel.swift +++ b/Sources/HummingbirdHTTP2/HTTP2UpgradeChannel.swift @@ -40,7 +40,7 @@ public struct HTTP2UpgradeChannel: HTTPChannelHandler { self.http1.responder } - /// Initialize HTTP2Channel + /// Initialize HTTP2Channel /// - Parameters: /// - tlsConfiguration: TLS configuration /// - additionalChannelHandlers: Additional channel handlers to add to stream channel pipeline after HTTP part decoding and @@ -66,7 +66,7 @@ public struct HTTP2UpgradeChannel: HTTPChannelHandler { ) } - /// Initialize HTTP2UpgradeChannel + /// Initialize HTTP2UpgradeChannel /// - Parameters: /// - tlsConfiguration: TLS configuration /// - configuration: HTTP2 channel configuration @@ -84,9 +84,9 @@ public struct HTTP2UpgradeChannel: HTTPChannelHandler { self.http2 = HTTP2Channel(responder: responder, configuration: configuration) } - /// Initialize HTTP2UpgradeChannel + /// Initialize HTTP2UpgradeChannel /// - Parameters: - /// - tlsConfiguration: TLS configuration + /// - tlsChannelConfiguration: TLS channel configuration /// - configuration: HTTP2 channel configuration /// - responder: Function returning a HTTP response for a HTTP request public init( diff --git a/Sources/HummingbirdHTTP2/HTTPServerBuilder+http2.swift b/Sources/HummingbirdHTTP2/HTTPServerBuilder+http2.swift index 6c085903..054ab1d4 100644 --- a/Sources/HummingbirdHTTP2/HTTPServerBuilder+http2.swift +++ b/Sources/HummingbirdHTTP2/HTTPServerBuilder+http2.swift @@ -17,7 +17,7 @@ import NIOCore import NIOSSL extension HTTPServerBuilder { - /// Build HTTP channel with HTTP2 upgrade + /// Build HTTP channel with HTTP2 upgrade /// /// Use in ``Hummingbird/Application`` initialization. /// ``` @@ -45,7 +45,7 @@ extension HTTPServerBuilder { } } - /// Build HTTP channel with HTTP2 upgrade + /// Build HTTP channel with HTTP2 upgrade /// /// Use in ``Hummingbird/Application`` initialization. /// ``` @@ -71,7 +71,7 @@ extension HTTPServerBuilder { } } - /// Build HTTP channel with HTTP2 upgrade + /// Build HTTP channel with HTTP2 upgrade /// /// Use in ``Hummingbird/Application`` initialization. /// ``` @@ -81,7 +81,7 @@ extension HTTPServerBuilder { /// ) /// ``` /// - Parameters: - /// - tlsConfiguration: TLS configuration + /// - tlsChannelConfiguration: TLS channel configuration /// - configuration: HTTP2 Upgrade channel configuration /// - Returns: HTTPChannelHandler builder public static func http2Upgrade( diff --git a/Sources/HummingbirdTLS/HTTPServerBuilder+tls.swift b/Sources/HummingbirdTLS/HTTPServerBuilder+tls.swift index f59ce547..4982b86d 100644 --- a/Sources/HummingbirdTLS/HTTPServerBuilder+tls.swift +++ b/Sources/HummingbirdTLS/HTTPServerBuilder+tls.swift @@ -16,7 +16,7 @@ import HummingbirdCore import NIOSSL extension HTTPServerBuilder { - /// Build server supporting HTTP with TLS + /// Build server supporting HTTP with TLS /// /// Use in ``Hummingbird/Application`` initialization. /// ``` @@ -25,6 +25,7 @@ extension HTTPServerBuilder { /// server: .tls(.http1(), tlsConfiguration: tlsConfiguration) /// ) /// ``` + /// /// - Parameters: /// - base: Base child channel to wrap with TLS /// - tlsConfiguration: TLS configuration @@ -38,15 +39,23 @@ extension HTTPServerBuilder { } } - /// Build server supporting HTTP with TLS + /// Build server supporting HTTP with TLS + /// + /// Use in ``Hummingbird/Application`` initialization. + /// + /// This version of the function adds extra configuration including a custom verification callback + /// which can be used to override the standard certificate verification. + /// + /// ``` + /// let app = Application( + /// router: router, + /// server: .tls(.http1(), configuration: .init( + /// tlsConfiguration: tlsConfiguration, + /// customAsyncVerificationCallback: { certificates in .certificateVerified } + /// )) + /// ) + /// ``` /// - /// Use in ``Hummingbird/Application`` initialization. - /// ``` - /// let app = Application( - /// router: router, - /// server: .tls(.http1(), tlsConfiguration: tlsConfiguration) - /// ) - /// ``` /// - Parameters: /// - base: Base child channel to wrap with TLS /// - configuration: TLS channel configuration