@@ -2858,7 +2858,10 @@ class HTTPClientTests: XCTestCase {
28582858
28592859 // We use a specially crafted client that has no cipher suites to offer. To do this we ask
28602860 // 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
28622865 let localHTTPBin = HTTPBin ( ssl: true )
28632866 let localClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
28642867 configuration: HTTPClient . Configuration ( tlsConfiguration: tlsConfig) )
@@ -2951,15 +2954,17 @@ class HTTPClientTests: XCTestCase {
29512954 }
29522955
29532956 // 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)
29552960 let firstResponse = try localClient. execute ( request: firstRequest) . wait ( )
29562961 guard let firstBody = firstResponse. body else {
29572962 XCTFail ( " No request body found " )
29582963 return
29592964 }
29602965 let firstConnectionNumber = try decoder. decode ( RequestInfo . self, from: firstBody) . connectionNumber
29612966
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 )
29632968 let secondResponse = try localClient. execute ( request: secondRequest) . wait ( )
29642969 guard let secondBody = secondResponse. body else {
29652970 XCTFail ( " No request body found " )
@@ -2968,7 +2973,10 @@ class HTTPClientTests: XCTestCase {
29682973 let secondConnectionNumber = try decoder. decode ( RequestInfo . self, from: secondBody) . connectionNumber
29692974
29702975 // 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)
29722980 let thirdResponse = try localClient. execute ( request: thirdRequest) . wait ( )
29732981 guard let thirdBody = thirdResponse. body else {
29742982 XCTFail ( " No request body found " )
0 commit comments