@@ -36,7 +36,7 @@ class TestHTTPDelegate: HTTPClientResponseDelegate {
36
36
return task. eventLoop. makeSucceededFuture ( ( ) )
37
37
}
38
38
39
- func didReceivePart ( task: HTTPClient . Task < Response > , _ buffer: ByteBuffer ) -> EventLoopFuture < Void > {
39
+ func didReceiveBodyPart ( task: HTTPClient . Task < Response > , _ buffer: ByteBuffer ) -> EventLoopFuture < Void > {
40
40
switch self . state {
41
41
case . head( let head) :
42
42
self . state = . body( head, buffer)
@@ -58,7 +58,7 @@ class CountingDelegate: HTTPClientResponseDelegate {
58
58
59
59
var count = 0
60
60
61
- func didReceivePart ( task: HTTPClient . Task < Response > , _ buffer: ByteBuffer ) -> EventLoopFuture < Void > {
61
+ func didReceiveBodyPart ( task: HTTPClient . Task < Response > , _ buffer: ByteBuffer ) -> EventLoopFuture < Void > {
62
62
let str = buffer. getString ( at: 0 , length: buffer. readableBytes)
63
63
if str? . starts ( with: " id: " ) ?? false {
64
64
self . count += 1
@@ -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