1

I am building a react native mobile application and I want to implement SSL pinning using react-native-ssl-pinning.

I've installed all the necessary things and I also imported fetch method:

import {fetch} from 'react-native-ssl-pinning';

This is how I am calling fetch method:

fetch("https://xxx.xxx.xxx.xx/api/account/my_account/", {
  method: "GET",
  headers: {
    Authorization: "Bearer " + token,
    Accept: "application/json; charset=utf-8",
    "Access-Control-Allow-Origin": "*",
    e_platform: "mobile",
  },
  sslPinning: {
    certs: ["mycert"],
  },
})
  .then((response) => response.json())
  .then((responseJson) => {
    console.log(responseJson);
  })
  .catch((error) => {
    console.log(error);
  });

After I run the application I get this error:

error image

Did someone have the same problem, or do you have some solution for this?

Thanks a lot.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.