-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: revert removal of SecureContext
_external
getter
This `_external` getter is essential for some libs to work: uWebSockets as an example. PR-URL: #21711 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Loading branch information
1 parent
1afd207
commit cdb6da9
Showing
4 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
if (!common.hasCrypto) | ||
common.skip('missing crypto'); | ||
|
||
const assert = require('assert'); | ||
const tls = require('tls'); | ||
|
||
// Ensure accessing ._external doesn't hit an assert in the accessor method. | ||
{ | ||
const pctx = tls.createSecureContext().context; | ||
const cctx = Object.create(pctx); | ||
assert.throws(() => cctx._external, TypeError); | ||
pctx._external; | ||
} | ||
{ | ||
const pctx = tls.createSecurePair().credentials.context; | ||
const cctx = Object.create(pctx); | ||
assert.throws(() => cctx._external, TypeError); | ||
pctx._external; | ||
} |