AFNetworking SSL固定过期证书 [英] AFNetworking SSL Pinning Expired Certificates
问题描述
如果在ios应用程序上使用ssl pinning,如何更新过期的ssl证书?似乎只有应用更新才能更新证书,但是未更新应用的用户将无法收到此更新。
How do you update expired ssl certificates if ssl pinning is used on ios apps? It seems like only an app update would enable updating the certificate but then users who don't update the app will not receive this update.
推荐答案
关键是要理解 AFSecurityPolicy的可能值
的 pinningMode
。
AFSSLPinningModeCertificate
表示服务器提供的证书必须与其中一个固定证书完全匹配,默认情况下是应用包中的证书。这是您当前使用的模式。
AFSSLPinningModeCertificate
means that the certificate provided by the server must match exactly one of the pinned certificates, which by default are the certificates in your app bundle. This is the mode you are currently using.
AFSSLPinningModePublicKey
表示服务器提供的证书必须包含相同的证书公钥作为您的应用程序固定的证书之一。
AFSSLPinningModePublicKey
means that the certificate provided by the server must contain the same public key as one of the certificates pinned by your app.
如果您使用 AFSSLPinningModePublicKey
并使用相同的密钥对续订(更新)您的服务器证书,您的iOS应用将继续无需修改即可工作。
If you use AFSSLPinningModePublicKey
and renew (update) your server certificate with the same keypair, your iOS app will continue to work without modification.
这篇关于AFNetworking SSL固定过期证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!