title: SSL Mutual Authentication from React Native
body: <p>I'm trying to perform SSL Mutual Authentication from React Native, with a library like <code>axios</code> or <code>fetch</code>.
  Basically, I need to present a certificate with each call, a reverse proxy is already configured to recognize this certificate and let the request pass-through.</p>
  <p>I managed to make my code work in NodeJS with following syntax :</p>
  <pre><code>const fs = require('fs');
  const https = require('https');
  const axios = require('axios');
  
  const httpsAgent = new https.Agent({
    cert: fs.readFileSync('./assets/mycert.pem'),
    key: fs.readFileSync('./assets/mykey.pem')
  });
  
  axios.get('https://myurl.com', { httpsAgent }).then((data) =&gt; {
     console.log(data);
  }).catch((error) =&gt; {
     console.log(error);
  });
  </code></pre>
  <p>I tried to get this code work in React Native with following libraries :</p>
  <ul>
  <li>Node libs for React Native (for <code>https</code>): <a href="https://github.com/parshap/node-libs-react-native" rel="nofollow noreferrer">https://github.com/parshap/node-libs-react-native</a></li>
  <li>File access to replace <code>fs</code> : <a href="https://github.com/joltup/rn-fetch-blob" rel="nofollow noreferrer">https://github.com/joltup/rn-fetch-blob</a></li>
  </ul>
  <p>It seems that it does not work because of <code>https.Agent</code>. When I try to log content of httpsAgent described above from React Native, I get <code>{}</code>.</p>
  <p>Would you have an idea ? Thanks !</p>