mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
504 B
28 lines
504 B
'use strict';
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto) {
|
|
common.skip('missing crypto');
|
|
return;
|
|
}
|
|
const tls = require('tls');
|
|
const stream = require('stream');
|
|
|
|
const delay = new stream.Duplex({
|
|
read: function read() {
|
|
},
|
|
write: function write(data, enc, cb) {
|
|
console.log('pending');
|
|
setImmediate(function() {
|
|
console.log('done');
|
|
cb();
|
|
});
|
|
}
|
|
});
|
|
|
|
const secure = tls.connect({
|
|
socket: delay
|
|
});
|
|
setImmediate(function() {
|
|
secure.destroy();
|
|
});
|
|
|