frw / react-native-ssl-public-key-pinning

Simple and secure SSL public key pinning for React Native. No native configuration needed, set up in <5 minutes.
MIT License
162 stars 13 forks source link

How to disable network inspector in react-native-cli #351

Closed gkasireddy202 closed 1 month ago

gkasireddy202 commented 2 months ago

I am using the react-native version:0.68.7. How to disable the network inspector on release and debug mode.

frw commented 1 month ago

Are you using Expo and expo-dev-client? If you're not, there is no need to disable Network Inspector.

gkasireddy202 commented 1 month ago

@frw - Thanks for your reply. I am using the react-native-ssl-public-key-pinning: 1.1.3 and react-native:0.68.7,react-native-cli in my project. I added the below code in the login button action and checked the API call showing in the network inspector on the iPhone device. I added the invalid public keys. I see the API call in the network inspector. await initializeSslPinning({ 'google.com': { includeSubdomains: true, publicKeyHashes: [ 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=', 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB=', ], }, });

      axios.get('https://www.google.com').then((response)=>{
        alert(JSON.stringify(response))
    })
    .catch((error)=>{
        alert(error)
    })

IMG_4086

frw commented 1 month ago

Are you actually getting a successful response from the network call, or is an error generated?

You should see the call on Network Inspector since it should attempt to make the connection, but it shouldn't resolve if you've set up pinning with the dummy keys.

gkasireddy202 commented 1 month ago

I got it. I will check with new public keys once I receive them from my admin team.

frw commented 1 month ago

Closing since this seems to have been resolved