任何人都让 NSURLConnection 在 iOS 9 上工作而无一例外?
Anyone got NSURLConnection working on iOS 9 without exceptions?
我正在尝试 运行 我的应用程序 iOS 9 -- Xcode 7 beta 5。虽然我的 URL 是 https,但 NSURL 连接仍然抛出错误:
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
我试图避免使用异常来使它正常工作。我的服务器支持所需的协议:https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/index.html
谢谢...
更新:release notes 表明他们已经放弃了对 DHE_RSA 密码的默认支持:
"DHE_RSA cipher suites are now disabled by default in Secure Transport for TLS clients. This may cause failure to connect to TLS servers that only support DHE_RSA cipher suites. Apps that explicitly enable cipher suites using SSLSetEnabledCiphers are not affected and will still use DHE_RSA cipher suites if explicitly enabled."
这些是我的服务器支持的密码。请在此处查看完整列表:
https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/index.html
所以我想我需要为每个 NSURLConnection 使用 SSLSetEnabledCiphers,或者升级我的服务器以支持 DHE_ECDSA 密码。或者暂时使用异常机制。
我错过了什么吗?谁有使用 SSLSetEnabledCiphers 的示例代码?
谢谢。
这是交易。关于默认不支持 DHE_RSA 密码套件的无伤大雅的语言是 Apple 在 beta 5 中的一个相当大的变化。默认情况下,许多服务器不支持 ECDHE_ECDSA 密码。为了在我的服务器上支持这些密码,看起来我将不得不升级某些东西或几个东西。或者甚至重新编译一些东西。确认
我假设我只需要确保所有 URL 都是 HTTPS!
具体来说,通过使用 info.plist 中的 "NSExceptionRequiresForwardSecrecy = NO" 键,我能够支持到我的服务器的仅 HTTPS 链接。如有必要,也不要忘记 "NSIncludesSubdomains = YES" 键。
有用的背景知识,特别是如果您不熟悉 Diffie-Helmen 交换、椭圆曲线和前向保密:
http://blog.ivanristic.com/2013/08/configuring-apache-nginx-and-openssl-for-forward-secrecy.html
http://blog.lowsnr.net/2014/10/26/configuring-apache-2-2-ssltls-for-forward-secrecy/
我正在尝试 运行 我的应用程序 iOS 9 -- Xcode 7 beta 5。虽然我的 URL 是 https,但 NSURL 连接仍然抛出错误:
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
我试图避免使用异常来使它正常工作。我的服务器支持所需的协议:https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/index.html
谢谢...
更新:release notes 表明他们已经放弃了对 DHE_RSA 密码的默认支持:
"DHE_RSA cipher suites are now disabled by default in Secure Transport for TLS clients. This may cause failure to connect to TLS servers that only support DHE_RSA cipher suites. Apps that explicitly enable cipher suites using SSLSetEnabledCiphers are not affected and will still use DHE_RSA cipher suites if explicitly enabled."
这些是我的服务器支持的密码。请在此处查看完整列表: https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/index.html
所以我想我需要为每个 NSURLConnection 使用 SSLSetEnabledCiphers,或者升级我的服务器以支持 DHE_ECDSA 密码。或者暂时使用异常机制。
我错过了什么吗?谁有使用 SSLSetEnabledCiphers 的示例代码?
谢谢。
这是交易。关于默认不支持 DHE_RSA 密码套件的无伤大雅的语言是 Apple 在 beta 5 中的一个相当大的变化。默认情况下,许多服务器不支持 ECDHE_ECDSA 密码。为了在我的服务器上支持这些密码,看起来我将不得不升级某些东西或几个东西。或者甚至重新编译一些东西。确认
我假设我只需要确保所有 URL 都是 HTTPS!
具体来说,通过使用 info.plist 中的 "NSExceptionRequiresForwardSecrecy = NO" 键,我能够支持到我的服务器的仅 HTTPS 链接。如有必要,也不要忘记 "NSIncludesSubdomains = YES" 键。
有用的背景知识,特别是如果您不熟悉 Diffie-Helmen 交换、椭圆曲线和前向保密:
http://blog.ivanristic.com/2013/08/configuring-apache-nginx-and-openssl-for-forward-secrecy.html
http://blog.lowsnr.net/2014/10/26/configuring-apache-2-2-ssltls-for-forward-secrecy/