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

Error: Ther certificate for this server is invalid

Open vietnguyen402 opened this issue 4 years ago • 12 comments

Hi everyone, I just started building app and using React-native-ssl-pinnig library to call api from server ssl, according to documentation library i has set up for android it works, but when When I set up it on ios, I get the following error: 33db28dfd4b120ef79a0 im using: React-native 0.60.5, I did the steps in the documentation and the result is as follows: Inked5d95f3c527abd3f58aba_LI Inked5b9f96bae4d1108f49c0_LI I tried creating another certificate and using it but it only works on android, ios it gives certificate error. I'm a newbie, Hope everyone can help and thanks you

vietnguyen402 avatar Jun 14 '21 03:06 vietnguyen402

I'm stuck on the same problem. Did you get to fix this?

FrancoPastor avatar Jul 13 '21 04:07 FrancoPastor

Stuck on same error. Please help if you find the fix. @FrancoPastor @vietnguyen402 @MaxToyberman

hetansh1 avatar Jul 13 '21 05:07 hetansh1

I am currently unable to fix this error. i'm looking for a way to fix it!

vietnguyen402 avatar Jul 27 '21 06:07 vietnguyen402

do you see the certificates in Bundle resources ? also, what is 192.168.1.30 ?

MaxToyberman avatar Jul 27 '21 07:07 MaxToyberman

it's the address of the server in my lan.

vietnguyen402 avatar Jul 28 '21 02:07 vietnguyen402

Stuck on same error. you have any solutions? @vietnguyen402

Pakile avatar Aug 10 '21 10:08 Pakile

@MaxToyberman I tried fetch("https://publicobject.com", { method: "GET" , pkPinning: true, sslPinning: { certs: ["sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="] } }) and error: "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “publicobject.com” which could put your confidential information at risk."

Pakile avatar Aug 10 '21 11:08 Pakile

I had this exact problem on iOS (14.5)

mrmarktyy avatar Sep 30 '21 05:09 mrmarktyy

The certificate generated by using the key chain of Mac can solve this problem

eliot-ye avatar Dec 28 '21 04:12 eliot-ye

Hi @eliot-ye,

can you be more specific, please?

Did you guys find a way how to fix this? Did anyone create a workaround?

martinfejes avatar Jan 20 '22 11:01 martinfejes

in iOS, make sure that you add the certificate to the bundle resources. Go to Build Phases > Copy bundle resources > Add the certificate.

dalugoda avatar Feb 10 '22 06:02 dalugoda

in iOS, make sure that you add the certificate to the bundle resources. Go to Build Phases > Copy bundle resources > Add the certificate.

Still facing this issue even after doing the above.

PS: we have been provided a certificate in .cer format, so not generating it from my mac

amaankulshreshtha avatar Mar 29 '22 10:03 amaankulshreshtha