@@ -27,14 +27,13 @@ class HTTP2ClientTests: XCTestCase {
27
27
func makeDefaultHTTPClient(
28
28
eventLoopGroupProvider: HTTPClient . EventLoopGroupProvider = . createNew
29
29
) -> HTTPClient {
30
- var tlsConfig = TLSConfiguration . makeClientConfiguration ( )
31
- tlsConfig. certificateVerification = . none
30
+ var config = HTTPClient . Configuration ( )
31
+ config. tlsConfiguration = . clientDefault
32
+ config. tlsConfiguration? . certificateVerification = . none
33
+ config. httpVersion = . automatic
32
34
return HTTPClient (
33
35
eventLoopGroupProvider: eventLoopGroupProvider,
34
- configuration: HTTPClient . Configuration (
35
- tlsConfiguration: tlsConfig,
36
- httpVersion: . automatic
37
- ) ,
36
+ configuration: config,
38
37
backgroundActivityLogger: Logger ( label: " HTTPClient " , factory: StreamLogHandler . standardOutput ( label: ) )
39
38
)
40
39
}
@@ -137,14 +136,13 @@ class HTTP2ClientTests: XCTestCase {
137
136
138
137
let localHTTPBin = HTTPBin ( . http2( compress: false ) )
139
138
let elg = MultiThreadedEventLoopGroup ( numberOfThreads: numberOfWorkers)
140
- var tlsConfig = TLSConfiguration . makeClientConfiguration ( )
141
- tlsConfig. certificateVerification = . none
139
+ var config = HTTPClient . Configuration ( )
140
+ config. tlsConfiguration = . clientDefault
141
+ config. tlsConfiguration? . certificateVerification = . none
142
+ config. httpVersion = . automatic
142
143
let localClient = HTTPClient (
143
144
eventLoopGroupProvider: . shared( elg) ,
144
- configuration: HTTPClient . Configuration (
145
- tlsConfiguration: tlsConfig,
146
- httpVersion: . automatic
147
- ) ,
145
+ configuration: config,
148
146
backgroundActivityLogger: Logger ( label: " HTTPClient " , factory: StreamLogHandler . standardOutput ( label: ) )
149
147
)
150
148
defer {
@@ -302,15 +300,14 @@ class HTTP2ClientTests: XCTestCase {
302
300
let el1 = clientGroup. next ( )
303
301
let el2 = clientGroup. next ( )
304
302
defer { XCTAssertNoThrow ( try clientGroup. syncShutdownGracefully ( ) ) }
305
- var tlsConfig = TLSConfiguration . makeClientConfiguration ( )
306
- tlsConfig. certificateVerification = . none
303
+ var config = HTTPClient . Configuration ( )
304
+ config. tlsConfiguration = . clientDefault
305
+ config. tlsConfiguration? . certificateVerification = . none
306
+ config. httpVersion = . automatic
307
+ config. timeout. connect = . milliseconds( 1000 )
307
308
let client = HTTPClient (
308
309
eventLoopGroupProvider: . shared( clientGroup) ,
309
- configuration: HTTPClient . Configuration (
310
- tlsConfiguration: tlsConfig,
311
- timeout: . init( connect: . milliseconds( 1000 ) ) ,
312
- httpVersion: . automatic
313
- ) ,
310
+ configuration: config,
314
311
backgroundActivityLogger: Logger ( label: " HTTPClient " , factory: StreamLogHandler . standardOutput ( label: ) )
315
312
)
316
313
defer { XCTAssertNoThrow ( try client. syncShutdown ( ) ) }
0 commit comments