UIWebView loadRequest forcing to https?

NSURL *url = [NSURL URLWithString:s];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[_webView loadRequest:request];

Somehow the request is getting converted from http to https in iOS 9 on iPad mini.

In my shouldStartLoadWithRequest method, I log the requests and I notice that it starts okay with the requests being http, then it suddenly changes to https without me doing anything.


Anyone seeing the same?

Accepted Reply

This is a new "security" feature. iOS 9 enforces secure connections, so all normal "http" connections will fail by default. Right now this won't work for many use cases, so you can opt-out for specific domains or even completely. Look for the keyword "App Transport Security" (ATS).


You'll find some more information in this thread:

https://forums.developer.apple.com/message/5857

Replies

I had the same issue


This post fixed it: http://www.fiveminutewatchkit.com/blog/2015/6/9/how-to-disable-app-transport-security


Also this is a duplicate of this: https://forums.developer.apple.com/thread/3544

This is a new "security" feature. iOS 9 enforces secure connections, so all normal "http" connections will fail by default. Right now this won't work for many use cases, so you can opt-out for specific domains or even completely. Look for the keyword "App Transport Security" (ATS).


You'll find some more information in this thread:

https://forums.developer.apple.com/message/5857

Thank you! It's not in the docs anywhere according to that thread.