How do I detect whether a web page in a UIWebView needs to use HTTP or HTTPS? I have an address bar where the user can type in “www.apple.com” and then I convert this to a NSString with http:// in front of it. If Apple.com requires HTTPS though, how would this be handled? What exactly should I do? Thanks for your help!
Share
In most cases, a web site that requires HTTPS is set up to automatically redirect to the correct SSL port. In generally goes like this:
So, in the vast majority of cases, you don’t need to know whether or not HTTPS is required or not. Just go to the site using http. If it requires HTTPS it will almost always redirect you there automatically.