在我的应用程序中,我使用 NSURLConnection
进行网络调用。但是,它默认使用 SSL V3
;但我需要将 TLS V1.1/1.2
与 NSURLConnection
一起使用。
我浏览了几个在线资源,但没有一个被证明是有用的。另外,我似乎无法阻止 NSURLConnection 使用 SSL V3。有没有一种方法可以强制 NSURLConnection
使用 TLS V1.1/1.2
,或者我是否必须更改我的代码才能使用 CFStream
API 或 Apple 提供的 SecureTransport
API?
最佳答案
来自 App Transport Security Technote
文档摘录:
Default Behavior
All connections using the NSURLConnection, CFURL, or NSURLSession APIs use App Transport Security default behavior in apps built for iOS 9.0 or later, and OS X 10.11 or later. Connections that do not follow the requirements will fail.
The App Transport Security requirements: The server must support at least Transport Layer Security (TLS) protocol version 1.2.
关于ios - 将 TLS V1.1/V 1.2 与 NSURLConnection 结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31477329/