【发布时间】:2016-08-05 09:32:26
【问题描述】:
我正在与 Visual Studio Cordova 合作,我们嵌入了一个 Iframe。在 android 上它工作正常,但在 Ios (9+) 上:
加载资源失败:发生 SSL 错误并且安全 无法连接到“服务器”。
我读过其他线程建议更改 NSAppTransportSecurity。我已经通过Transport Security Plugin 完成了。
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>mywebsite.com</key>
<dict>
<!--Include to allow subdomains-->
<key>NSIncludesSubdomains</key>
<true/>
<!--Include to allow HTTP requests-->
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<!--Include to specify minimum TLS version-->
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
</dict>
我已更改 CSP:
<meta http-equiv="Content-Security-Policy"
content="default-src * gap: ;
style-src 'self' 'unsafe-inline' 'unsafe-eval';
script-src 'self' 'unsafe-inline' 'unsafe-eval';
'child-src'*;
'frame-src':*;
" />
我仍然收到此错误。有什么帮助吗?
【问题讨论】: