@@ -97,8 +97,8 @@ internal class HttpBin {
97
97
}
98
98
99
99
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) ) )
102
102
let context = try ! NIOSSLContext ( configuration: configuration)
103
103
return channel. pipeline. addHandler ( try ! NIOSSLServerHandler ( context: context) , position: . first)
104
104
}
@@ -347,8 +347,8 @@ internal class HttpBinForSSLUncleanShutdown {
347
347
. childChannelInitializer { channel in
348
348
let requestDecoder = HTTPRequestDecoder ( )
349
349
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) ) )
352
352
let context = try ! NIOSSLContext ( configuration: configuration)
353
353
return channel. pipeline. addHandler ( try ! NIOSSLServerHandler ( context: context) , name: " NIOSSLServerHandler " , position: . first) . flatMap {
354
354
channel. pipeline. addHandler ( HttpBinForSSLUncleanShutdownHandler ( channelPromise: channelPromise) )
0 commit comments