Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AFNetworking SSL Pinning Expired Certificates

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.

like image 534
andrew Avatar asked Feb 26 '14 22:02

andrew


Video Answer


1 Answers

The key is to understand the possible values for AFSecurityPolicy's pinningMode.

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 means that the certificate provided by the server must contain the same public key as one of the certificates pinned by your app.

If you use AFSSLPinningModePublicKey and renew (update) your server certificate with the same keypair, your iOS app will continue to work without modification.

like image 150
David Snabel-Caunt Avatar answered Oct 31 '22 04:10

David Snabel-Caunt