Skip to content

Commit

Permalink
fix macOS
Browse files Browse the repository at this point in the history
umair-ably committed Aug 5, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 5ff8c49 commit 31b4a9b
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/ARTURLSessionServerTrust.m
Original file line number Diff line number Diff line change
@@ -14,7 +14,15 @@ - (instancetype)init:(dispatch_queue_t)queue {
_queue = queue;
NSURLSessionConfiguration *config = [NSURLSessionConfiguration ephemeralSessionConfiguration];

// version check required for macOS 10.15
#if TARGET_OS_MACCATALYST
config.TLSMinimumSupportedProtocolVersion = tls_protocol_version_TLSv12;
#else
if (@available(iOS 13.0, macOS 10.15, tvOS 13.0, *)) {
config.TLSMinimumSupportedProtocolVersion = tls_protocol_version_TLSv12;
} else {
}
#endif
_session = [NSURLSession sessionWithConfiguration:config delegate:self delegateQueue:nil];
}
return self;
7 changes: 7 additions & 0 deletions Source/SocketRocket/Internal/Proxy/ARTSRProxyConnect.m
Original file line number Diff line number Diff line change
@@ -239,7 +239,14 @@ - (void)_fetchPAC:(NSURL *)PACurl withProxySettings:(NSDictionary *)proxySetting
__weak typeof(self) wself = self;
NSURLRequest *request = [NSURLRequest requestWithURL:PACurl];
NSURLSessionConfiguration *config = [NSURLSessionConfiguration ephemeralSessionConfiguration];
#if TARGET_OS_MACCATALYST // if (@available(iOS 13.0, macCatalyst 13.0, ... doesn't help
config.TLSMinimumSupportedProtocolVersion = tls_protocol_version_TLSv12;
#else
if (@available(iOS 13.0, macOS 10.15, tvOS 13.0, *)) {
config.TLSMinimumSupportedProtocolVersion = tls_protocol_version_TLSv12;
} else {
}
#endif
NSURLSession *session = [NSURLSession sessionWithConfiguration:config delegate:nil delegateQueue:nil];
[[session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
__strong typeof(wself) sself = wself;

0 comments on commit 31b4a9b

Please sign in to comment.