带有自签名证书的请求https文件错误

时间:2019-09-27 09:13:53

标签: swift https

我正在使用Shine Updater更新自己的应用程序。我还构建了具有自签名证书的https文件服务器。但是,当我调用URL函数获取文件时,收到以下错误消息

 1.TIC SSL Trust Error
 2.NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
 3.HTTP load failed (error code: -1202 [3:-9813])
 4.NSURLConnection finished with error - code -1202
 Shine: Error downloading Feed: Error Domain=NSCocoaErrorDomain Code=256 "The file “appcast.xml” couldn’t be opened."

我的示例代码如下

Shine.shared.setup { config in
        config.feedURL = URL(string: "https://xxx.xxx.xxx.xxx/appcast.xml")!
}

我尝试过的是

1。我将以下信息添加到info.plist

<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSAllowsLocalNetworking</key>
        <true/>
    </dict>
</dict>

2。我用过

URL(fileURLWithPath: "https://xxx.xxx.xxx.xxx/appcast.xml")

我不知道如何解决此问题,有什么建议吗?

0 个答案:

没有答案