Loading HTTPS in UIWebView

10,909

Actually found a solution here: UIWebView to view self signed websites (No private api, not NSURLConnection) - is it possible?

What it actually does is to intercept the UIWebView to launch a NSURLConnection to allow the server to be authenticated, therefore then continue the connection using UIWebView, and cancels out the NSURLConnection. Reason so is because after authorising the server once, the rest of the continuous connection would not be blocked. Hope i'm clear. :)

Share:
10,909
Annabel
Author by

Annabel

I do love programming and is now working as a part time programmer in a company :)

Updated on June 04, 2022

Comments

  • Annabel
    Annabel almost 2 years

    I have a page with UIWebView, it was working well until recently some of the redirection changed, with the URL from HTTP to HTTPS. The page could not be displayed.

    Error logged:

    Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid.
    

    Now, I wish to bypass all the cert checks and allow all the certs. Tried using this How to use NSURLConnection to connect with SSL for an untrusted cert? but the error still comes out. Help, anyone? Thanks!