title: Node.js - HTTPS PFX Error: Unable to load BIO
body: <p>I'm trying to make a HTTPS request-promise. I already know that the PFX is good and that is not the issue (I have a similar sample app working).</p>
  
  <p>I am doing the following:</p>
  
  <pre><code>var request = require('request-promise');
  </code></pre>
  
  <p>...</p>
  
  <pre><code>options.pfx = fs.readFileSync('myfile.pfx');
  options.passphrase = 'passphrase';
  </code></pre>
  
  <p>I am passing my options into an request.</p>
  
  <pre><code>request.post(options);
  </code></pre>
  
  <p>I then try to build the request I get the following error:</p>
  
  <pre><code>_tls_common.js:130
    c.context.loadPKCS12(pfx, passphrase);
              ^
  
  Error: Unable to load BIO
  at Error (native)
  at Object.createSecureContext (_tls_common.js:130:17)
  at Object.exports.connect (_tls_wrap.js:955:21)
  at Agent.createConnection (https.js:73:22)
  at Agent.createSocket (_http_agent.js:174:16)
  at Agent.addRequest (_http_agent.js:143:23)
  at new ClientRequest (_http_client.js:133:16)
  at Object.exports.request (http.js:31:10)
  at Object.exports.request (https.js:163:15)
  at Request.start (/Users/filomeno/workspace/sla-crawler/node_modules/request/request.js:747:30)
  at Request.write (/Users/filomeno/workspace/sla-crawler/node_modules/request/request.js:1369:10)
  at end (/Users/filomeno/workspace/sla-crawler/node_modules/request/request.js:561:16)
  at Immediate._onImmediate (/Users/filomeno/workspace/sla-crawler/node_modules/request/request.js:589:7)
  at processImmediate [as _immediateCallback] (timers.js:374:17)
  </code></pre>
  
  <p>I have a sample app where the same code works. 
  I've tried to convert to .p12 without success.</p>
  
  <p>Does anyone have an idea what this error might refer to?</p>
  
  <p>Edit:
  I'm using lodash to do a merge of 2 objects with dinamic properties and static properties</p>
  
  <pre><code>_.merge(options, _this.requestOptions);
  </code></pre>
  
  <p>And that was causing the problem</p>