-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
document limitations of TSKAdditionalTrustAnchors on iOS 11 #154
Comments
Hello and thanks for letting us know - that's a very interesting change from Apple. We will do more testing on our side and update the documentation as needed. |
We're having some difficulties getting SSL pinning with a custom root certificate to work, probably also because of the ATS limitation. @bjlaub did setting the |
I will do my own testing this week as well. |
@vicdelfant you should still be able to pin a custom CA cert in the usual way, but iOS needs to trust the certificate. The issue here is that, it seems, with iOS 11 you can no longer programmatically set anchor certs for trust evaluation, without also disabling ATS. You can add certs for iOS to use by opening them in Safari and clicking through the prompts to install the certificate - since iOS 10.3 you also need to explicitly tell iOS to trust them after they are installed (see https://www.thesslstore.com/blog/trust-manually-installed-root-certificates-in-ios/). As far as I know the only ways to get iOS to trust custom CA certs is to do this process manually, or deploy them via an MDM. |
@bjlaub Do you know which specific ATS exemption is needed for custom anchors to work again? |
i think you can disable ATS for a specific domain by setting
This has the downside of apparently also allowing insecure HTTP loads for that domain. FWIW, in my testing i think this worked for |
Very interesting. Yeah that exemption is pretty dangerous, so Apple clearly wants to get rid of customized SSL validation. I will try it out as well. |
Thanks! We have tested using We have reached out to Apple Developer Technical Support with a link to this issue, hopefully they can shed some light on this as well. I'll report back if they do. |
I finally had some time to look into this. Unfortunately I don't think there's a workaround; the root certificate must be installed on the device on iOS 11, as disabling ATS just for this would be too dangerous. It's also clear that it is Apple's intent to limit how much developers can customize their app's SSL validation (to prevent mistakes, which is good); even if there was a workaround, it probably would stop working on the next version of iOS. Hence, my plan is to also remove the Thanks! |
There's more information about this in the main article about ATS:
|
@nabla-c0d3 No objections from me. The feature is now partially obsolete with new Security Framework on-device proxying (Charles Proxy iOS app). “break glass” self-signed backup keys were nice to have, but not a deal breaker. Thanks for checking. |
Seems I completely forgot to let you all know what Apple Developer Technical Support replied with, apologies. Their recommendation was simply to not use our own root CA but use a trusted CA instead (which of course removes the need to disable ATS). Also, they could not confirm nor deny that the ability to add a custom root CA and perform our own chain trust verification by disabling ATS might disappear in the future. Pinning the public key of the leaf certificate, along with a proper backup pin for an inactive private key, turned out to be sufficient for our use case. |
Released with v1.6.0. |
As far as I can tell, App Transport Security (when fully enabled) no longer allows evaluating TLS trust using custom anchors in iOS 11. This means that setting
kTSKAdditionalTrustAnchors
will have no effect if ATS is enabled. This behavior of ATS seems to be distinctly different from iOS 10, which does allow evaluation using custom anchors even if ATS is enabled. On iOS 10, settingkTSKAdditionalTrustAnchors
works as expected.This limitation on iOS 11 should probably be documented, so as not to catch folks (like me) off-guard.
See also: https://stackoverflow.com/questions/46316604/ios-11-ats-app-transport-security-no-longer-accepts-custom-anchor-certs
and Apple's notes on ATS requirements which state
(from: https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW57)
The text was updated successfully, but these errors were encountered: