Cordova IOS =>'无法加载资源:发生SSL错误'
问题描述:
我正在使用visual studio cordova,我们嵌入了iframe。在Android上它工作正常,但在iOS(9+):Cordova IOS =>'无法加载资源:发生SSL错误'
无法加载资源:发生了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':*;
" />
我STIL得到这个错误。有什么帮助吗?
答
实际上它来自嵌入的iframe。 它使用sha-1签名进行认证,Apple不允许使用此签名。所以我正在改变签名。