Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
}
}

@available(iOS, introduced: 5.0, deprecated: 13.0)
extension TLSVersion {
/// return as SSL protocol
var sslProtocol: SSLProtocol {
Expand Down Expand Up @@ -67,15 +68,27 @@
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
if let maximumTLSVersion = self.maximumTLSVersion {
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
}
}

Expand Down