Reputation: 51
i want to load url in web view like as
NSString *urlAddress = @"http://ashu007blr.tumblr.com/loadadd";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[self.adWeb loadRequest:requestObj];
but i get error like as
The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
i find solution for google then i added NSAppTransportSecurity
in my info.plist
like as
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
but it is not working i get same error.
Upvotes: 1
Views: 1606
Reputation: 2999
Did you do this?
Open your info.plist file like this picture
https://i.sstatic.net/uxpZY.jpg
And add the following two attributes
NSAppTransportSecurity
NSAllowsArbitraryLoads
Note: 1st one is NSDictionary type and second one is BOOL Type
Upvotes: 2
Reputation: 8245
This occurs for HTTPS connections to servers that don't have the appropriate setup for Perfect Forward Secrecy.
See Apple's Tech Note which lists the requirements.
Our own server https://prod.ly needed a new SSL certificate, namely one with SHA256 signature. It was still using an older, less secure, algorithm.
These are the App Transport Security requirements:
These are the accepted ciphers:
PS: You can check your server's suitability for ATS/PFC with the SSL Labs checker page: e.g. https://www.ssllabs.com/ssltest/analyze.html?d=api.productlayer.com
PPS: Your original URL might be HTTP, but there are several resources referenced from the HTML that comes back that are accessed via HTTPS, e.g. https://secure.assets.tumblr.com
Upvotes: 0