I am constantly getting
SSL handshake with client failed - Remote host terminated the handshake
error in Charles Proxy from iOS 16.1, which should indicate that certificate isn't trusted, but I granted full trust in the iPhone settings.
Here are steps to reproduce:
I can see requests in Charles Proxy but they all are with SSL handshake error. Also, Safari on iPhone returns the error "This Connection Is Not Private"
Can someone explain what am I doing wrong?
Here is the screenshot from the Certificate Trust Settings.
Finally, I found the problem. In my case, it was an expired certificate. In order to fix it, it is necessary to go to Help -> SSL Proxying -> Reset Charles Root Certificate...
. It will generate a new one. Then it is needed to install it and grant trust to it.
I wasn't noticing it because before I was working only with Android and it didn't check if a certificate was expired, unlike iOS.
Because I wasn't been able to find any troubleshooting checklist for similar situations I will mention it here. Hopefully, it will help somebody:
Enable SSL Proxying
is enabled in Proxy -> SSL Proxying Settings...
Exclude
list doesn't contain the locations that you are trying to record.Proxy -> Record Settings
doesn't have unneeded excludes or includesHelp -> SSL Proxying -> Reset Charles Root Certificate...
and reinstall the certificate.network_security_config.xml
referenced in AndroidManifest.xml