Search code examples
iossfsafariviewcontrollersafariservices

Allow a self signed certificate in the SFSafariViewController


Is it possible to programmatically validate a self signed certificate in SFSafariViewController like in WKWebView with the delegate method ?

webView(_:didReceiveAuthenticationChallenge:completionHandler:)

Solution

  • Unfortunately, no. The only delegate is SFSafariViewControllerDelegate, which does not let you intercept SSL protocol negotiation requests. SFSafariViewController is run out-of-process, and most things are blocked to protect the user from the calling app being able to intercept and read content.

    Your only option is to install and trust the certificate out of process, either via MDM or by having the user consent to install and trust it.