NSURLSession / NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9802)Xamarin.Forms IOS

时间:2019-05-01 09:23:45

标签: ios ssl xamarin.forms xamarin.ios

我开发了Web视图要导航到Web演示,URL是

https://demos.xretail.com

我用

编辑了info.plist
  <dict>
    <key>NSExceptionAllowsInsecureHTTPLoads</key>
    <true/>
  </dict>
  <key>NSAppTransportSecurity</key>
  <dict>
    <key>NSExceptionDomains</key>
    <dict>
      <key>www.the-domain-name.com</key>
      <dict>
        <key>NSExceptionMinimumTLSVersion</key>
        <string>TLSv1.0</string>
        <key>NSExceptionRequiresForwardSecrecy</key>
        <false/>
        <key>NSExceptionAllowsInsecureHTTPLoads</key>
        <true/>
        <key>NSIncludesSubdomains</key>
        <true/>
        <key> NSAllowsArbitraryLoadsInWebContent</key>
        <true/>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
      </dict>
    </dict>
  </dict>

并且我在应用程序委托中使用了paybass证书,但这对我不起作用

  ServicePointManager
.ServerCertificateValidationCallback +=
(sender, cert, chain, sslPolicyErrors) => true;

1 个答案:

答案 0 :(得分:0)

您可以尝试更改iOS构建设置吗?

  1. 使用 NSUrlSession
  2. 更改HttpClient实施