I want to implement ssl pinning (pinning public key) in my project. To do that, i use react-native-ssl-pinning.
I follow the instructions to install, and it works well with android.
However, on iOS, I always get an error "Cancelled". When run from xcode, I get this error:
HTTP load failed, 0/0 bytes (error code: -999 [1:89])
It seems to be a problem with the certificate, but I can't identify it.
According to apple's documentation, the certificate must:
- have a keysize greater or equal to 2048 bits
- use algorithm of SHA-2 family
- present the DNS name of the server in the Subject Alternative Name extension
- contain an ExtendedKeyUsage (EKU) extension containing the id-kp-serverAuth OID
- have a validity period of 825 days or fewer (as expressed in the NotBefore and NotAfter fields of the certificate).
The certificate I use seems to be valid, and I decided to ask here if someone has a working solution or at least a hint after searching unsuccessfully myself.