forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tls: deprecate undocumented .ssl property, add docs
deprecate the legacy undocumented `.ssl` alias for the `TLSSocket._handle` and document alternatives. Document how to properly use the `TLSSocket` constructor directly. Updated take on nodejs#10846 Fixes: nodejs#10555
- Loading branch information
Showing
6 changed files
with
141 additions
and
14 deletions.
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
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,31 @@ | ||
// Flags: --no-warnings | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
if (!common.hasCrypto) | ||
common.skip('missing crypto'); | ||
|
||
const tls = require('tls'); | ||
const fixtures = require('../common/fixtures'); | ||
|
||
const key = fixtures.readKey('agent2-key.pem'); | ||
const cert = fixtures.readKey('agent2-cert.pem'); | ||
|
||
const server = tls.createServer({ key, cert }, (socket) => { | ||
socket.ssl; // This should trigger a deprecation warning | ||
socket.setEncoding('utf8'); | ||
socket.pipe(socket); | ||
}); | ||
server.listen(0, () => { | ||
const options = { rejectUnauthorized: false }; | ||
const socket = | ||
tls.connect(server.address().port, options, common.mustCall(() => { | ||
socket.end('hello'); | ||
})); | ||
socket.resume(); | ||
socket.on('end', () => server.close()); | ||
}); | ||
|
||
common.expectWarning('DeprecationWarning', | ||
'The tlsSocket.ssl property is deprecated.', | ||
'DEP00XX'); |
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