@@ -2858,7 +2858,10 @@ class HTTPClientTests: XCTestCase {
2858
2858
2859
2859
// We use a specially crafted client that has no cipher suites to offer. To do this we ask
2860
2860
// only for cipher suites incompatible with our TLS version.
2861
- let tlsConfig = TLSConfiguration . forClient ( minimumTLSVersion: . tlsv13, maximumTLSVersion: . tlsv12, certificateVerification: . none)
2861
+ var tlsConfig = TLSConfiguration . makeClientConfiguration ( )
2862
+ tlsConfig. minimumTLSVersion = . tlsv13
2863
+ tlsConfig. maximumTLSVersion = . tlsv12
2864
+ tlsConfig. certificateVerification = . none
2862
2865
let localHTTPBin = HTTPBin ( ssl: true )
2863
2866
let localClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
2864
2867
configuration: HTTPClient . Configuration ( tlsConfiguration: tlsConfig) )
@@ -2951,15 +2954,17 @@ class HTTPClientTests: XCTestCase {
2951
2954
}
2952
2955
2953
2956
// First two requests use identical TLS configurations.
2954
- let firstRequest = try HTTPClient . Request ( url: " https://localhost: \( localHTTPBin. port) /get " , method: . GET, tlsConfiguration: . forClient( certificateVerification: . none) )
2957
+ var tlsConfig = TLSConfiguration . makeClientConfiguration ( )
2958
+ tlsConfig. certificateVerification = . none
2959
+ let firstRequest = try HTTPClient . Request ( url: " https://localhost: \( localHTTPBin. port) /get " , method: . GET, tlsConfiguration: tlsConfig)
2955
2960
let firstResponse = try localClient. execute ( request: firstRequest) . wait ( )
2956
2961
guard let firstBody = firstResponse. body else {
2957
2962
XCTFail ( " No request body found " )
2958
2963
return
2959
2964
}
2960
2965
let firstConnectionNumber = try decoder. decode ( RequestInfo . self, from: firstBody) . connectionNumber
2961
2966
2962
- let secondRequest = try HTTPClient . Request ( url: " https://localhost: \( localHTTPBin. port) /get " , method: . GET, tlsConfiguration: . forClient ( certificateVerification : . none ) )
2967
+ let secondRequest = try HTTPClient . Request ( url: " https://localhost: \( localHTTPBin. port) /get " , method: . GET, tlsConfiguration: tlsConfig )
2963
2968
let secondResponse = try localClient. execute ( request: secondRequest) . wait ( )
2964
2969
guard let secondBody = secondResponse. body else {
2965
2970
XCTFail ( " No request body found " )
@@ -2968,7 +2973,10 @@ class HTTPClientTests: XCTestCase {
2968
2973
let secondConnectionNumber = try decoder. decode ( RequestInfo . self, from: secondBody) . connectionNumber
2969
2974
2970
2975
// Uses a differrent TLS config.
2971
- let thirdRequest = try HTTPClient . Request ( url: " https://localhost: \( localHTTPBin. port) /get " , method: . GET, tlsConfiguration: . forClient( maximumTLSVersion: . tlsv1, certificateVerification: . none) )
2976
+ var tlsConfig2 = TLSConfiguration . makeClientConfiguration ( )
2977
+ tlsConfig2. certificateVerification = . none
2978
+ tlsConfig2. maximumTLSVersion = . tlsv1
2979
+ let thirdRequest = try HTTPClient . Request ( url: " https://localhost: \( localHTTPBin. port) /get " , method: . GET, tlsConfiguration: tlsConfig2)
2972
2980
let thirdResponse = try localClient. execute ( request: thirdRequest) . wait ( )
2973
2981
guard let thirdBody = thirdResponse. body else {
2974
2982
XCTFail ( " No request body found " )
0 commit comments