【问题标题】:Spotify iOS SDK and App Transport Security ios9Spotify iOS SDK 和应用传输安全 ios9
【发布时间】:2015-12-25 13:35:59
【问题描述】:

我在我的应用程序中使用了 spotify sdk。在 ios 8 中一切正常,但现在当我尝试连接时出现错误

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

我在 .plist 中添加了这一行

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>api.spotify.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSTemporaryExceptionMinimumTLSVersion</key>
                <string>1.0</string>
                <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <key>accounts.spotify.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSTemporaryExceptionMinimumTLSVersion</key>
                <string>1.0</string>
                <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
        </dict>
    </dict>

但这无济于事。那么,有人可以帮我以正确的方式配置 .plist 吗?谢谢!

【问题讨论】:

    标签: spotify ios9 info.plist app-transport-security


    【解决方案1】:

    应该这样做:

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>cloudfront.net</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
        </dict>
    </dict>
    

    【讨论】:

      猜你喜欢
      • 2016-02-13
      • 2016-01-25
      • 2015-09-03
      • 2015-11-29
      • 2016-02-12
      • 2016-03-23
      • 2016-01-17
      • 2016-08-27
      相关资源
      最近更新 更多