[英]UIWebview not load URL in ios9
i want to load url in web view like as 我想像这样在网络视图中加载URL
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 我找到了谷歌的解决方案,然后我在我的
info.plist
添加了NSAppTransportSecurity
,如下所示
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
but it is not working i get same error. 但它不起作用,我得到同样的错误。
Did you do this? 你做了这个了吗?
Open your info.plist file like this picture 像这样打开您的info.plist文件
http://imgur.com/mVvKD1R http://imgur.com/mVvKD1R
And add the following two attributes 并添加以下两个属性
NSAppTransportSecurity NSAppTransportSecurity
NSAllowsArbitraryLoads NSAllowsArbitraryLoads
Note: 1st one is NSDictionary type and second one is BOOL Type 注意:第一个是NSDictionary类型,第二个是BOOL类型
This occurs for HTTPS connections to servers that don't have the appropriate setup for Perfect Forward Secrecy. 对于没有正确设置Perfect Forward Secrecy的服务器的HTTPS连接,会发生这种情况。
See Apple's Tech Note which lists the requirements. 请参阅Apple的技术说明 ,其中列出了要求。
Our own server https://prod.ly needed a new SSL certificate, namely one with SHA256 signature. 我们自己的服务器https://prod.ly需要一个新的SSL证书,即带有SHA256签名的SSL证书。 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: eg https://www.ssllabs.com/ssltest/analyze.html?d=api.productlayer.com PS:您可以通过SSL Labs检查器页面检查服务器对ATS / PFC的适用性:例如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, eg https://secure.assets.tumblr.com PPS:您的原始URL可能是HTTP,但是从HTML返回的引用的一些资源可以通过HTTPS访问,例如https://secure.assets.tumblr.com
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.