@@ -97,8 +97,8 @@ internal class HttpBin{
9797}
9898
9999static func configureTLS( channel: Channel ) -> EventLoopFuture < Void > {
100- let configuration = TLSConfiguration . forServer ( certificateChain: [ . certificate( try ! NIOSSLCertificate ( buffer : cert. utf8. map ( Int8 . init ) , format: . pem) ) ] ,
101- privateKey: . privateKey( try ! NIOSSLPrivateKey ( buffer : key. utf8. map ( Int8 . init ) , format: . pem) ) )
100+ let configuration = TLSConfiguration . forServer ( certificateChain: [ . certificate( try ! NIOSSLCertificate ( bytes : Array ( cert. utf8) , format: . pem) ) ] ,
101+ privateKey: . privateKey( try ! NIOSSLPrivateKey ( bytes : Array ( key. utf8) , format: . pem) ) )
102102let context = try ! NIOSSLContext ( configuration: configuration)
103103return channel. pipeline. addHandler ( try ! NIOSSLServerHandler ( context: context) , position: . first)
104104}
@@ -347,8 +347,8 @@ internal class HttpBinForSSLUncleanShutdown{
347347. childChannelInitializer { channel in
348348let requestDecoder = HTTPRequestDecoder ( )
349349return channel. pipeline. addHandler ( ByteToMessageHandler ( requestDecoder) ) . flatMap {
350- let configuration = TLSConfiguration . forServer ( certificateChain: [ . certificate( try ! NIOSSLCertificate ( buffer : cert. utf8. map ( Int8 . init ) , format: . pem) ) ] ,
351- privateKey: . privateKey( try ! NIOSSLPrivateKey ( buffer : key. utf8. map ( Int8 . init ) , format: . pem) ) )
350+ let configuration = TLSConfiguration . forServer ( certificateChain: [ . certificate( try ! NIOSSLCertificate ( bytes : Array ( cert. utf8) , format: . pem) ) ] ,
351+ privateKey: . privateKey( try ! NIOSSLPrivateKey ( bytes : Array ( key. utf8) , format: . pem) ) )
352352let context = try ! NIOSSLContext ( configuration: configuration)
353353return channel. pipeline. addHandler ( try ! NIOSSLServerHandler ( context: context) , name: " NIOSSLServerHandler " , position: . first) . flatMap {
354354 channel. pipeline. addHandler ( HttpBinForSSLUncleanShutdownHandler ( channelPromise: channelPromise) )
0 commit comments