Swift CFNetwork SSLHandshake在UIWebView中加载URL失败(-9824)
我访问的所有帖子和教程都提供了编辑info.plist文件的解决方案,我也这么做了 编辑plist文件适用于google.co.in,但不适用于 我只是想知道我的错误 请导游 我的信息列表Swift CFNetwork SSLHandshake在UIWebView中加载URL失败(-9824),swift,uiwebview,ios9,cfnetwork,sslhandshakeexception,Swift,Uiwebview,Ios9,Cfnetwork,Sslhandshakeexception,我访问的所有帖子和教程都提供了编辑info.plist文件的解决方案,我也这么做了 编辑plist文件适用于google.co.in,但不适用于 我只是想知道我的错误 请导游 我的信息列表 编辑 我尝试将我的info.plist更新为: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/Pr
编辑 我尝试将我的info.plist更新为:
<?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>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.abcd.abcdAppstore.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>onlinesbi.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<true/>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.2</string>
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
<false/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<true/>
<key>NSThirdPartyExceptionMinimumTLSVersion</key>
<string>TLSv1.2</string>
<key>NSRequiresCertificateTransparency</key>
<false/>
</dict>
</dict>
</dict>
</dict>
</plist>
CfBundledDevelopmentRegion
EN
Cbundlexecutable
$(可执行文件名称)
CbundleIdentifier
com.abcd.abcdAppstore.$(产品名称:rfc1034identifier)
CbundleInfo字典版本
6
CFBundleName
$(产品名称)
CbundlePackageType
BNDL
CbundleShortVersionString
1
CFBundleSignature
????
循环流化床锅炉
1.
NSAppTransportSecurity
NSExceptionDomains
onlinesbi.com
n包括多个域
N异常低安全Http负载
NSExceptionRequiresForwardSecretary
NSExceptionMinimumTLSVersion
TLSv1.2
N第三方异常低安全Http负载
N第三方例外要求转发保密
第三方例外最小版本
TLSv1.2
NSRequiresCertificateTransparency
但web视图仍然是空的:-(
任何帮助都将不胜感激。请提前感谢info.plist,如下所示,或者直接复制并通过iOS 9.2版本
<?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>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</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>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
NSAppTransportSecurity
NSAllowsArbitraryLoads
CfBundledDevelopmentRegion
EN
Cbundlexecutable
$(可执行文件名称)
CbundleIdentifier
$(产品\捆绑包\标识符)
CbundleInfo字典版本
6
CFBundleName
$(产品名称)
CbundlePackageType
应用
CbundleShortVersionString
1
CFBundleSignature
????
循环流化床锅炉
1
LSREQUIRESPHONEOS
UILaunchStoryboardName
发射屏
UIMainstryBoardFile
主要
UIRequiredDeviceCapabilities
armv7
UI支持接口方向
UIInterfaceOrientationPortrait
UIInterface方向和左视图
UIInterfaceOrientationAndscapeRight
UI支持界面方向~ipad
UIInterfaceOrientationPortrait
UIInterfaceOrientation上下方向图
UIInterface方向和左视图
UIInterfaceOrientationAndscapeRight
最终得到的答案是:
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
NSAppTransportSecurity
NSAllowsArbitraryLoads
为我工作
我只是把它放在最后&而不是一开始。我最近遇到了这个问题,这里发布的答案对我来说不起作用……但我在AppDelegate(Swift)找到了一个不同的解决方案
我希望它能帮助一些人。我还收到了相同类型的错误2016-02-16 23:46:28.598 sslcMerchant[2982:314081]CFNetwork SSLHandshake失败(-9824)2016-02-16 23:46:28.598 sslcMerchant[2982:314082]NSURLSession/NSURLConnection HTTP加载失败(KCFStreamerDomainSSL,-9824)@matinict我仍然停留在这一点上。我不知道为什么!!起作用,但不起作用。可能有一些证书问题!!如果我们能够确切地知道证书问题,那么至少我们可以在我们的项目中解决这个问题。:-(不,它不起作用:-(我添加了这个代码:NSAppTransportSecurity NSAllowsArbitraryLoads它只是显示一个白色屏幕,没有异常被打印为日志。我做了一个新项目并做了相同的代码,它工作得非常正确。我认为问题在于Xcode和iOS版本升级。谢谢大家。)你的支持(+1)。
<?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>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</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>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
extension NSURLRequest {
static func allowsAnyHTTPSCertificateForHost(host: String) -> Bool {
return true
}}