tls: forward new SecureContext options

We have a few places where we individually forward each
parameter to tls.createSecureContext(). In #28973 and others,
we added new SecureContext options but forgot to keep these
places up to date.

As per https.Agent#getName, I understand that at least
`privateKeyIdentifier` and `privateKeyEngine` should be
added too, since they're a substitute for `key`. I've
also added sigalgs.

Fixes: https://github.com/nodejs/node/issues/36322
Refs: https://github.com/nodejs/node/pull/28973

PR-URL: https://github.com/nodejs/node/pull/36416
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Alba Mendez authored and Michaël Zasso committed 2021-05-01 09:44:40 +02:00
1 parent 3701e5d14f
commit 08ed2337ea
3 files changed
+31 -4

No files matched your search

+13
View File
@@ -24,6 +24,7 @@
const {
ObjectAssign,
ObjectSetPrototypeOf,
JSONStringify,
} = primordials;
require('internal/util').assertCrypto();
@@ -236,6 +237,18 @@ Agent.prototype.getName = function getName(options) {
if (options.sessionIdContext)
name += options.sessionIdContext;
name += ':';
if (options.sigalgs)
name += JSONStringify(options.sigalgs);
name += ':';
if (options.privateKeyIdentifier)
name += options.privateKeyIdentifier;
name += ':';
if (options.privateKeyEngine)
name += options.privateKeyEngine;
return name;
};