In my app I\'m using https and a self-signed SSL certificate to secure the connection between my client and the server.
I was trying to have the AFNetworking library
If you're using AFNetworking 2.x, and you're using the correct .cer but still receiving error code -1012 on your calls, you should disable validatesCertificateChain
:
AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
securityPolicy.validatesCertificateChain = NO;
or you can pass it all in the entire certificate chain in pinnedCertificates
.