Last active
March 17, 2022 05:20
-
-
Save t0rr3sp3dr0/83c1ad8087eaf3dfc09f23e085b2f0de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Delegate: NSObject, URLSessionDelegate { | |
public func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { | |
let serverTrust = challenge.protectionSpace.serverTrust! | |
let exceptions = SecTrustCopyExceptions(serverTrust) | |
SecTrustSetExceptions(serverTrust, exceptions) | |
completionHandler(.performDefaultHandling, URLCredential(trust: serverTrust)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment