Reputation: 2791
I want to convert the below PHP code into nodejs. For curl operation, I'm using https packages.
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $SSlCertPwd);
How we can set SSL cert password in https.agent?
Please help me.
Upvotes: 3
Views: 3311
Reputation: 2693
https.Agent
takes an object with options, including passphrase
:
const options = {
hostname: '...',
port: 443,
path: '...',
method: '...',
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
passphrase: 'super secret'
};
const agent = new https.Agent(options);
Upvotes: 3