objective-c - iOS 13 TLS 问题

标签 objective-c xcode tls1.2 ios13

我已经安装了 iOS 13 beta 版本并运行了包含大量网络请求的框架,但出现了这个错误:

2019-09-19 15:01:33.566811+0200 ---[395:25439] Connection 4: default TLS Trust evaluation failed(-9814)
2019-09-19 15:01:33.567022+0200 ---[395:25439] Connection 4: TLS Trust encountered error 3:-9814
2019-09-19 15:01:33.567110+0200 ---[395:25439] Connection 4: encountered error(3:-9814)
2019-09-19 15:01:33.569824+0200 ---[395:25439] Connection 4: unable to determine interface type without an established connection
2019-09-19 15:01:33.584952+0200 ---[395:25439] Task <D97FD611-0B48-4DCE-99C9-6A971E5E6524>.<4> HTTP load failed, 0/0 bytes (error code: -1202 [3:-9814])

我试图找出导致该问题的原因,但没有成功。谁能帮帮我?

最佳答案

Apple 定义了 stricter rules对于 TLS 服务器证书,从 iOS 13 和 macOS 10.15 开始。

All TLS server certificates must comply with these new security requirements in iOS 13 and macOS 10.15:

TLS server certificates and issuing CAs using RSA keys must use key sizes greater than or equal to 2048 bits. Certificates using RSA key sizes smaller than 2048 bits are no longer trusted for TLS.

TLS server certificates and issuing CAs must use a hash algorithm from the SHA-2 family in the signature algorithm. SHA-1 signed certificates are no longer trusted for TLS.

TLS server certificates must present the DNS name of the server in the Subject Alternative Name extension of the certificate. DNS names in the CommonName of a certificate are no longer trusted.

Additionally, all TLS server certificates issued after July 1, 2019 (as indicated in the NotBefore field of the certificate) must follow these guidelines:

TLS server certificates must contain an ExtendedKeyUsage (EKU) extension containing the id-kp-serverAuth OID.

TLS server certificates must have a validity period of 825 days or fewer (as expressed in the NotBefore and NotAfter fields of the certificate).

最后的注释:

Connections to TLS servers violating these new requirements will fail and may cause network failures, apps to fail, and websites to not load in Safari in iOS 13 and macOS 10.15.

关于objective-c - iOS 13 TLS 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58011737/

相关文章:

objective-c - Cocoa Core Data 计算实体的有效方法

ios - 遇到405错误如何删除collectionview记录?

objective-c - UIWebview中如何获取超链接的坐标

ios - 有没有一种有效的方法来创建大量 GMSMarker 对象?

ssl - XP POSReady 和 TLS 1.2

java - 如何检查我的应用正在使用哪种 TLS 协议(protocol)进行网络操作

Tomcat8 SSL查询

ios - OCMock:如何 stub -[NSString stringWithContentsOfURL:encoding:error:]

c - 适用于 MAC 开发的 Xcode : How to have a keybinding for menu item?

iphone - 延迟返回值而不是整个方法