forwardemail / forwardemail/superagent
There is no ability to provide passphrase for a private key
- Dominant language
- JavaScript
- Stars
- 16.6k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
There should be an ability to provide a passphrase for a private key. Https.request supports it.
From https://nodejs.org/api/https.html#https_https_request_options_callback
> The following additional options from tls.connect() are also accepted: ca, cert, ciphers, clientCertEngine, crl, dhparam, ecdhCurve, honorCipherOrder, key, passphrase, pfx, rejectUnauthorized, secureOptions, secureProtocol, servername, sessionIdContext.
```
// Example piece of https code
const key,cert,passphrase, ca; //Will have correct values. Leaving it blank for brevity.
const options = {
host: 'https',
path: '',
method: post,
headers: {
'Content-Type': 'application/json',
'Contentlength': 100
},
key,
cert,
passphrase,
ca,
rejectUnauthorized: false,
checkServerIdentity: function (host, cert) {
return undefined;
}
};
options.agent = new https.Agent(options);
const req = https.request(options, (res) => {
console.log('All OK. Server matched our pinned cert or public key');
console.log('statusCode:', res.statusCode);
console.log('headers:', res.headers);
res.on('data', console.log);
});
```
Contributor guide
Research direction
Start by tracing how superagent handles private-key options and compare that path with the passphrase option accepted by Node.js https.request and https.Agent. Done means callers can provide a passphrase alongside key and cert for HTTPS requests, with coverage for the supported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, security
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100