@@ -97,8 +97,8 @@ internal class HttpBin {
9797 }
9898
9999 static 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) ) )
102102 let context = try ! NIOSSLContext ( configuration: configuration)
103103 return channel. pipeline. addHandler ( try ! NIOSSLServerHandler ( context: context) , position: . first)
104104 }
@@ -347,8 +347,8 @@ internal class HttpBinForSSLUncleanShutdown {
347347 . childChannelInitializer { channel in
348348 let requestDecoder = HTTPRequestDecoder ( )
349349 return 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) ) )
352352 let context = try ! NIOSSLContext ( configuration: configuration)
353353 return channel. pipeline. addHandler ( try ! NIOSSLServerHandler ( context: context) , name: " NIOSSLServerHandler " , position: . first) . flatMap {
354354 channel. pipeline. addHandler ( HttpBinForSSLUncleanShutdownHandler ( channelPromise: channelPromise) )
0 commit comments