diff --git a/SocketRocket/SocketRocket/Internal/Proxy/ARTSRProxyConnect.m b/SocketRocket/SocketRocket/Internal/Proxy/ARTSRProxyConnect.m index c7475997f..e1d6cc848 100644 --- a/SocketRocket/SocketRocket/Internal/Proxy/ARTSRProxyConnect.m +++ b/SocketRocket/SocketRocket/Internal/Proxy/ARTSRProxyConnect.m @@ -236,7 +236,13 @@ - (void)_fetchPAC:(NSURL *)PACurl withProxySettings:(NSDictionary *)proxySetting } __weak typeof(self) wself = self; NSURLRequest *request = [NSURLRequest requestWithURL:PACurl]; - NSURLSession *session = [NSURLSession sharedSession]; + NSURLSessionConfiguration *config = [NSURLSessionConfiguration ephemeralSessionConfiguration]; + if (@available(iOS 13.0, macOS 10.15, tvOS 13.0, *)) { + config.TLSMinimumSupportedProtocolVersion = tls_protocol_version_TLSv12; + } else { + config.TLSMinimumSupportedProtocol = kTLSProtocol12; + } + NSURLSession *session = [NSURLSession sessionWithConfiguration:config delegate:nil delegateQueue:nil]; [[session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { __strong typeof(wself) sself = wself; if (!error) {