且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Cordova白名单iOS 10 SSL错误:无法加载资源:发生了SSL错误,无法建立与服务器的安全连接

更新时间:2021-12-28 21:45:42

看起来这不是白名单,而是App Transport Security问题。

It looks like this isn't a whitelist but an App Transport Security issue.

我使用iOS 10将视频上传到Vimeo。似乎Vimeo的SSL证书可能有问题。他们可能使用旧的TLS版本。当我关闭应用程序传输安全在plist它只是工作:

I got the videos to upload to Vimeo using iOS 10. It looks like there may be a problem with Vimeo's SSL certificate. They may use an old TLS version. When I turned off the App Transport Security in the plist it just worked:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>

所以没有关闭所有的东西我最后添加下面的代码在plist只vimeo.com:

So without turning everything off I ended up adding the code below in the plist for vimeo.com only:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>vimeo.com</key>
        <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionMinimumTLSVersion</key>
            <string>TLSv1.0</string>
            <key>NSRequiresCertificateTransparency</key>
            <false/>
        </dict>
    </dict>
</dict>

我希望能帮助任何人。