swift - Swift 的 SSL 连接错误
问题描述
我对这个我无法弄清楚的新错误感到沮丧。
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9800)
HTTP load failed (error code: -1200 [3:-9800])
Optional("An SSL error has occurred and a secure connection to the server cannot be made.")
以下是 info.plist
<key>NSAppTransportSecurity</key>
我在tomcat中配置了godaddy ssl,并且只允许在httpd中使用tls1.2+。我不明白为什么会收到此错误。请帮助我找出这个问题并理解为什么会发生这种情况。
当我这样做时nscurl --ats-diagnostics https://myserver:port#
,我得到
---
TLSv1.3 with PFS disabled and insecure HTTP allowed
2018-05-14 23:15:07.512 nscurl[36044:8746632] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9800)
Result : FAIL
---
如果我弄清楚这一点,我认为其他一切都会奏效。如果您对此有所了解,请帮助我。
我不想添加任意负载。我对此没有正当理由,但许多帖子说这是一个临时解决方案,对安全性有不良影响。
如果需要更多信息,请发表评论。感谢您的时间和帮助。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>SOMETHING</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb1787966001498993</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>1787966001498993</string>
<key>FacebookDisplayName</key>
<string>MathMatch</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<key>NSPhotoLibraryUsageDescription</key>
<string></string>
<key>UIAppFonts</key>
<array>
<string>Brandon_bld.otf</string>
<string>NotoSans-Regular.ttf</string>
<string>DINPro_Regular.ttf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
解决方案
推荐阅读
- r - 基于来自数据帧的组 id 的标准差
- powershell - 从参数 powershell 调用函数
- python - 如何使用换行符作为分隔符?
- kubernetes - GitOps:跨多个命名空间推出对 k8s 资源的更改
- python - 简化一系列 if 语句
- r - 将经度和纬度与 R 中的国家/地区匹配
- tensorflow - 如何将 LSTM 自动编码器向前推进 n 个时间步?
- android - RecyclerView只在重启Activity后显示数据
- javascript - chai、自定义断言覆盖和否定
- c# - .NET Core Windows Forms 应用程序:在 Visual Studio 2019 工具箱中找不到 System.Timers.Timer