Skip to content

Commit e74b039

Browse files
sichanyooSichan Yoo
andauthored
Fix tlsOptions so it's nil if protocol type is HTTP. (#667)
Co-authored-by: Sichan Yoo <[email protected]>
1 parent 9a749d0 commit e74b039

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/ClientRuntime/Networking/Http/CRT/CRTClientEngine.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ public class CRTClientEngine: HTTPClient {
6868
}
6969

7070
private func createConnectionPool(endpoint: Endpoint) throws -> HTTPClientConnectionManager {
71-
let tlsConnectionOptions = TLSConnectionOptions(
71+
let tlsConnectionOptions = endpoint.protocolType == .https ? TLSConnectionOptions(
7272
context: sharedDefaultIO.tlsContext,
7373
serverName: endpoint.host
74-
)
74+
) : nil
7575

7676
var socketOptions = SocketOptions(socketType: .stream)
7777
#if os(iOS) || os(watchOS)

0 commit comments

Comments
 (0)