@@ -40,6 +40,7 @@ const messageUtf8 = 'x√ab c';
40
40
const messageAscii = 'xb\b\u001aab c' ;
41
41
42
42
const server = tls . Server ( options , common . mustCall ( function ( socket ) {
43
+ console . log ( 'server: on secureConnection' , socket . getProtocol ( ) ) ;
43
44
socket . end ( messageUtf8 ) ;
44
45
} ) ) ;
45
46
@@ -55,12 +56,18 @@ server.listen(0, function() {
55
56
client . setEncoding ( 'ascii' ) ;
56
57
57
58
client . on ( 'data' , function ( d ) {
59
+ console . log ( 'client: on data' , d ) ;
58
60
assert . ok ( typeof d === 'string' ) ;
59
61
buffer += d ;
60
62
} ) ;
61
63
64
+ client . on ( 'secureConnect' , common . mustCall ( ( ) => {
65
+ console . log ( 'client: on secureConnect' ) ;
66
+ } ) ) ;
67
+
68
+ client . on ( 'close' , common . mustCall ( function ( ) {
69
+ console . log ( 'client: on close' ) ;
62
70
63
- client . on ( 'close' , function ( ) {
64
71
// readyState is deprecated but we want to make
65
72
// sure this isn't triggering an assert in lib/net.js
66
73
// See https://github.com/nodejs/node-v0.x-archive/issues/1069.
@@ -75,5 +82,5 @@ server.listen(0, function() {
75
82
assert . strictEqual ( messageAscii , buffer ) ;
76
83
77
84
server . close ( ) ;
78
- } ) ;
85
+ } ) ) ;
79
86
} ) ;
0 commit comments