GeezerVison is showing github.com — tls: forward new SecureContext options · nodejs/node@08ed233
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: lib/_tls_wrap.js +11-1Lines changed: 11 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -1320,6 +1320,9 @@ Server.prototype.setSecureContext = function(options) { | 1320 | 1320 | if (options.ticketKeys) | 1321 | 1321 | this.ticketKeys = options.ticketKeys; | 1322 | 1322 |
| | 1323 | + this.privateKeyIdentifier = options.privateKeyIdentifier; | | 1324 | + this.privateKeyEngine = options.privateKeyEngine; | | 1325 | + | 1323 | 1326 | this._sharedCreds = tls.createSecureContext({ | 1324 | 1327 | pfx: this.pfx, | 1325 | 1328 | key: this.key, | @@ -1339,7 +1342,9 @@ Server.prototype.setSecureContext = function(options) { | 1339 | 1342 | crl: this.crl, | 1340 | 1343 | sessionIdContext: this.sessionIdContext, | 1341 | 1344 | ticketKeys: this.ticketKeys, | 1342 | | - sessionTimeout: this.sessionTimeout | | 1345 | + sessionTimeout: this.sessionTimeout, | | 1346 | + privateKeyIdentifier: this.privateKeyIdentifier, | | 1347 | + privateKeyEngine: this.privateKeyEngine, | 1343 | 1348 | }); | 1344 | 1349 | }; | 1345 | 1350 |
| @@ -1405,6 +1410,11 @@ Server.prototype.setOptions = deprecate(function(options) { | 1405 | 1410 | } | 1406 | 1411 | if (options.pskCallback) this[kPskCallback] = options.pskCallback; | 1407 | 1412 | if (options.pskIdentityHint) this[kPskIdentityHint] = options.pskIdentityHint; | | 1413 | + if (options.sigalgs) this.sigalgs = options.sigalgs; | | 1414 | + if (options.privateKeyIdentifier !== undefined) | | 1415 | + this.privateKeyIdentifier = options.privateKeyIdentifier; | | 1416 | + if (options.privateKeyEngine !== undefined) | | 1417 | + this.privateKeyEngine = options.privateKeyEngine; | 1408 | 1418 | }, 'Server.prototype.setOptions() is deprecated', 'DEP0122'); | 1409 | 1419 |
| 1410 | 1420 | // SNI Contexts High-Level API | |
Collapse file Copy file name to clipboardExpand all lines: lib/https.js +13Lines changed: 13 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 24 | 24 | const { | 25 | 25 | ObjectAssign, | 26 | 26 | ObjectSetPrototypeOf, | | 27 | + JSONStringify, | 27 | 28 | } = primordials; | 28 | 29 |
| 29 | 30 | require('internal/util').assertCrypto(); | @@ -236,6 +237,18 @@ Agent.prototype.getName = function getName(options) { | 236 | 237 | if (options.sessionIdContext) | 237 | 238 | name += options.sessionIdContext; | 238 | 239 |
| | 240 | + name += ':'; | | 241 | + if (options.sigalgs) | | 242 | + name += JSONStringify(options.sigalgs); | | 243 | + | | 244 | + name += ':'; | | 245 | + if (options.privateKeyIdentifier) | | 246 | + name += options.privateKeyIdentifier; | | 247 | + | | 248 | + name += ':'; | | 249 | + if (options.privateKeyEngine) | | 250 | + name += options.privateKeyEngine; | | 251 | + | 239 | 252 | return name; | 240 | 253 | }; | 241 | 254 |
| |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-https-agent-getname.js +7-3Lines changed: 7 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,7 @@ const agent = new https.Agent(); | 12 | 12 | // empty options | 13 | 13 | assert.strictEqual( | 14 | 14 | agent.getName({}), | 15 | | - 'localhost:::::::::::::::::::' | | 15 | + 'localhost::::::::::::::::::::::' | 16 | 16 | ); | 17 | 17 |
| 18 | 18 | // Pass all options arguments | @@ -34,11 +34,15 @@ const options = { | 34 | 34 | secureOptions: 0, | 35 | 35 | secureProtocol: 'secureProtocol', | 36 | 36 | servername: 'localhost', | 37 | | - sessionIdContext: 'sessionIdContext' | | 37 | + sessionIdContext: 'sessionIdContext', | | 38 | + sigalgs: 'sigalgs', | | 39 | + privateKeyIdentifier: 'privateKeyIdentifier', | | 40 | + privateKeyEngine: 'privateKeyEngine', | 38 | 41 | }; | 39 | 42 |
| 40 | 43 | assert.strictEqual( | 41 | 44 | agent.getName(options), | 42 | 45 | '0.0.0.0:443:192.168.1.1:ca:cert:dynamic:ciphers:key:pfx:false:localhost:' + | 43 | | - '::secureProtocol:c,r,l:false:ecdhCurve:dhparam:0:sessionIdContext' | | 46 | + '::secureProtocol:c,r,l:false:ecdhCurve:dhparam:0:sessionIdContext:' + | | 47 | + '"sigalgs":privateKeyIdentifier:privateKeyEngine' | 44 | 48 | ); |
|