title: Cordova SSL pinning error 500: "There was an error with the request"
body: <p>I'm trying to do SSL pinning with Cordova 5.3.3 and Android with the following plugin: 
  <a href="https://github.com/wymsee/cordova-HTTP" rel="nofollow">https://github.com/wymsee/cordova-HTTP</a></p>
  
  <p>When I enable the pinning with the following funcion and I do the GET it throws me an Error 500: "There was an error with the request". (All tests are done inside the android device using the inspector). </p>
  
  <pre><code>window.cordovaHTTP.enableSSLPinning(
      true,
      function(res) {console.log("SSL pinning: " + res)},
      function(err) {console.log("SSL pinning: " + err)}
  );
  
  window.cordovaHTTP.get(
      "https://95.85.12.4/test.json",
      {}, // optional params
      {}, // optional headers
      function(res) {console.log(res)},
      function(err) {console.log(err)}
  );
  </code></pre>
  
  <p>If I accept all certs everything works fine due the fact that I'm overlapping the configuration of the pinning.</p>
  
  <pre><code>window.cordovaHTTP.enableSSLPinning(
      true,
      function(res) {console.log("SSL pinning: " + res)},
      function(err) {console.log("SSL pinning: " + err)}
  );
  
  window.cordovaHTTP.acceptAllCerts(
      true,
      function(res) {console.log('Accept all certs: ' + res)},
      function(err) {console.log('Accept all certs: ' + err)}
  );
  
  window.cordovaHTTP.get(
      "https://95.85.12.4/test.json",
      {}, // optional params
      {}, // optional headers
      function(res) {console.log(res)},
      function(err) {console.log(err)}
  );
  </code></pre>
  
  <p>I'm doing this tests in my server running NGINX. <a href="https://95.85.12.4/test.json" rel="nofollow">https://95.85.12.4/test.json</a></p>
  
  <p>I white-listed everything (just for testing purposes) </p>
  
  <pre><code>&lt;!-- Enable all requests, inline styles, and eval() --&gt;
  &lt;meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"&gt;
  </code></pre>
  
  <p>I also set the debuggable variable into the AndroidManifest.xml to true.</p>
  
  <pre><code>&lt;application android:debuggable="true"&gt;
  </code></pre>
  
  <p>My certificate is self-signed with DER format and .cer extension.
  I checked that the certificate is correct with openssl. 
  If I install the certificate in my machine there's no problem opening the server URL with
  the browser.</p>
  
  <p>The certificates are located into the /www/certificates folder inside my Cordova project.
  I also added the .cer insinde /platforms/android/assets.</p>
  
  <p>Any idea?</p>
  
  <p>Thanks!</p>