diff --git a/Sources/AsyncHTTPClient/NIOTransportServices/TLSConfiguration.swift b/Sources/AsyncHTTPClient/NIOTransportServices/TLSConfiguration.swift index e1003dd93..4653a25eb 100644 --- a/Sources/AsyncHTTPClient/NIOTransportServices/TLSConfiguration.swift +++ b/Sources/AsyncHTTPClient/NIOTransportServices/TLSConfiguration.swift @@ -35,6 +35,7 @@ } } + @available(iOS, introduced: 5.0, deprecated: 13.0) extension TLSVersion { /// return as SSL protocol var sslProtocol: SSLProtocol { @@ -67,7 +68,13 @@ if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) { sec_protocol_options_set_min_tls_protocol_version(options.securityProtocolOptions, self.minimumTLSVersion.nwTLSProtocolVersion) } else { - sec_protocol_options_set_tls_min_version(options.securityProtocolOptions, self.minimumTLSVersion.sslProtocol) + #if compiler(>=5.3) + #if !targetEnvironment(macCatalyst) + sec_protocol_options_set_tls_min_version(options.securityProtocolOptions, self.minimumTLSVersion.sslProtocol) + #else + preconditionFailure("macCatalyst 13 is the first version of macCatalyst") + #endif + #endif } // maximum TLS protocol @@ -75,7 +82,13 @@ if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) { sec_protocol_options_set_max_tls_protocol_version(options.securityProtocolOptions, maximumTLSVersion.nwTLSProtocolVersion) } else { - sec_protocol_options_set_tls_max_version(options.securityProtocolOptions, maximumTLSVersion.sslProtocol) + #if compiler(>=5.3) + #if !targetEnvironment(macCatalyst) + sec_protocol_options_set_tls_max_version(options.securityProtocolOptions, maximumTLSVersion.sslProtocol) + #else + preconditionFailure("macCatalyst 13 is the first version of macCatalyst") + #endif + #endif } }