-
Notifications
You must be signed in to change notification settings - Fork 743
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
Bump macOS minimum deployment target to 10.15 #1925
Conversation
This change is to handle the deprecation of the URLSessionTask.init() method.
8b251d7
to
c0523d0
Compare
var result: SecTrustResultType = .unspecified | ||
SecTrustEvaluate(trust,&result) | ||
if result == .unspecified || result == .proceed { | ||
if SecTrustEvaluateWithError(trust,nil) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic loses the .unspecified
(default) behaviour but I think it's better now that we take action based only on the return. We don't gather any error because it was not being logged before and I don't see any good way in this module to output it in a way that is actually useful to a production app.
SecTrustEvaluateWithError(:,:)
is the synchronous replacement of the deprecated SecTrustEvaluate(:,:)
. It is now a simple boolean return.
@@ -205,8 +203,8 @@ open class SSLSecurity : SSLTrustValidator { | |||
SecTrustCreateWithCertificates(cert, policy, &possibleTrust) | |||
|
|||
guard let trust = possibleTrust else { return nil } | |||
var result: SecTrustResultType = .unspecified | |||
SecTrustEvaluate(trust, &result) | |||
_ = SecTrustEvaluateWithError(trust, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result was not being used here so we don't store it either with the new call. Again, no error was being reported perviously.
SecTrustEvaluateWithError(:,:)
is the synchronous replacement of the deprecated SecTrustEvaluate(:,:)
. It is now a simple boolean return.
This is on hold while #1943 is evaluated. |
@calvincestari My company's app has iOS 14 as its deployment target, so it's getting a deprecation warning on |
Hi @OrindaCoder 👋🏻 - correct, we still support iOS 12 which is why the code still uses that deprecated The solution here could be to simply merge the changes in 1df7341 into main as I mentioned above. We're still in 0.x releases so making that kind of breaking change now is somewhat acceptable. If you have an alternate solution though please feel free to submit a PR and we can certainly review and discuss. |
@calvincestari I will wait for a future version of Apollo that fixes this warning. Thanks for all the work you do! |
This PR is a DRAFT:
URLSessionTask.sendRequest
returnThis change is in preparation for being able to target SQLite.swift version 0.13.0 which requires a minimum of macOS 10.15.
Deprecations as a result of dropping 10.14:
URLSessionTask.init
is no longer available soURLSessionTask.sendRequest
now returns an optional task withnil
being returned when the request could not be sent.Closes #1868