0
我需要加載使用webView
一個https
的要求,這是我的示例代碼錯誤加載HTTPS請求使用web視圖上iOS9
NSString *url = @"https://www.example.com";
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]];
[self.webView loadRequest:request];
當我使用的XCode 7.0,它適用於iOS7和iOS8上的罰款,但對iOS9失敗了,這裏是ATS配置
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>www.example.com</key>
<dict>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
的配置不起作用,就iOS9在Safari中打開https://www.example.com
失敗,我該如何解決?
我已經編輯您的文章,以使其更清晰。但是,就目前來看,這是很難回答的。您需要進一步編輯您的帖子以包含「失敗」的含義。 – IKavanagh
謝謝,它返回kCFURLErrorSecureConnectionFailed,我覺得網頁有問題,因爲在ios9上,safari也無法打開url – stupidrobot
您是否找到解決方案? – David