react-native-ssl-pinning icon indicating copy to clipboard operation
react-native-ssl-pinning copied to clipboard

The certificate for this server is invalid. You might be connecting to a server that is pretending to be “...” which could put your confidential information at risk. #106

Open suleymanbasbug opened this issue 2 years ago • 6 comments
trafficstars

I am trying to do this but get error (IOS 14.2):

The certificate for this server is invalid. You might be connecting to a server that is pretending to be “https://...” which could put your confidential information at risk.

I copied the .cer certificate into xcode and do this:

const response = await fetch(url, {
        method: 'GET',
        sslPinning: {
          certs: ['my_cer_file_without_extension'], // your certificates name (without extension)
        },
        headers: {
          Accept: 'application/json; charset=utf-8',
          'Access-Control-Allow-Origin': '*',
          e_platform: 'mobile',
        },
      });

Am I doing something wrong or is it no longer working? Any ideas?

suleymanbasbug avatar Sep 05 '23 17:09 suleymanbasbug

Is your cert a self signed?

idrakimuhamad avatar Sep 13 '23 08:09 idrakimuhamad

Is your cert a self signed?

Yes

suleymanbasbug avatar Sep 13 '23 09:09 suleymanbasbug

Is your cert a self signed?

Yes

Yeah won't work AFAIK. Unless you patch the package code to accept invalid cert.

idrakimuhamad avatar Sep 13 '23 14:09 idrakimuhamad

@suleymanbasbug Hey have you find a way to solve this issue, I'm struggling on it too

Aeners avatar Jan 05 '24 10:01 Aeners

@Aeners Hey, man. I stopped using this package. We implemented it natively.

suleymanbasbug avatar May 08 '24 08:05 suleymanbasbug

@suleymanbasbug Can you please share you native implementation to us. It can be in form of a blog.

hasil-cstack avatar Jul 24 '24 09:07 hasil-cstack