ios - 将 TLS V1.1/V 1.2 与 NSURLConnection 结合使用

标签 ios objective-c ssl nsurlconnection

在我的应用程序中,我使用 NSURLConnection 进行网络调用。但是,它默认使用 SSL V3;但我需要将 TLS V1.1/1.2NSURLConnection 一起使用。

我浏览了几个在线资源,但没有一个被证明是有用的。另外,我似乎无法阻止 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/

相关文章:

ios - Apple 在 "Your Second iOS App"的开头我做错了什么?

objective-c - 该键值是否符合要求?

ios - Apple TV第4代中的Powerpoint

javascript - React native 听写在 iOS 上突然削减单词

ios - 使用xcode项目生成类图

python - 使用 Anaconda Python 在 Windows 10 Git Bash 上导入错误 import _ssl

node.js - 通过 HTTPS 运行 nodejs 应用程序

sql-server - 带 SSL 的 MSSQL : The target principal name is incorrect

ios - 在 iOS 中呈现锁屏的最佳方式是什么?

iphone - 应用程序在启动时崩溃非常罕见