how can I prevent handshake when certificate is user installed for example if user is using Proxyman or Charles proxy and they install their own certificates now system is trusting those certificates I wanna prevent that, and exclude those certificates that are installed by user, and accept the handshake if CA certificate is in a real valid certificate defined in OS
I know this can be done in android by setting something like
<network-security-config>
<base-config>
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>
If you’re using our high-level HTTP APIs — that is, URLSession
or another built on top of it — then you can take advantage of the certificate pinning support in App Transport Security. See the NSPinnedDomains
documentation.
IMPORTANT Certificate pinning is a two-edged sword. It lets you block debugging HTTP proxies but it also prevents your app from working in certain high-security environments, which use the same underlying technique to implement TLS inspection.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"