Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/1079 #1120

Merged
merged 5 commits into from
Jul 26, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 23 additions & 1 deletion Source/ARTURLSessionServerTrust.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,29 @@ @implementation ARTURLSessionServerTrust
- (instancetype)init:(dispatch_queue_t)queue {
if (self = [super init]) {
_queue = queue;
_session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] delegate:self delegateQueue:nil];
NSURLSessionConfiguration *config = [NSURLSessionConfiguration ephemeralSessionConfiguration];
#if TARGET_OS_IOS
lukasz-szyszkowski marked this conversation as resolved.
Show resolved Hide resolved
if (@available(iOS 13.0, *)) {
config.TLSMinimumSupportedProtocolVersion = tls_protocol_version_TLSv12;
} else {
config.TLSMinimumSupportedProtocol = kTLSProtocol12;
}
#elif TARGET_OS_OSX
if (@available(macOS 10.15, *)) {
config.TLSMinimumSupportedProtocolVersion = tls_protocol_version_TLSv12;
} else {
config.TLSMinimumSupportedProtocol = kTLSProtocol12;
}
#elif TARGET_OS_TV
if (@available(tvOS 13.0, *)) {
config.TLSMinimumSupportedProtocolVersion = tls_protocol_version_TLSv12;
} else {
config.TLSMinimumSupportedProtocol = kTLSProtocol12;
}
#else
config.TLSMinimumSupportedProtocol = kTLSProtocol12;
#endif
_session = [NSURLSession sessionWithConfiguration:config delegate:self delegateQueue:nil];
}
return self;
}
Expand Down