@@ -18,7 +18,7 @@ exports.debug = util.debuglog('test');
18
18
exports . tls = tls ;
19
19
20
20
// Pre-load keys from common fixtures for ease of use by tests.
21
- const keys = exports . keys = {
21
+ exports . keys = {
22
22
agent1 : load ( 'agent1' , 'ca1' ) ,
23
23
agent2 : load ( 'agent2' , 'agent2' ) ,
24
24
agent3 : load ( 'agent3' , 'ca2' ) ,
@@ -31,9 +31,9 @@ const keys = exports.keys = {
31
31
ec : load ( 'ec' , 'ec' ) ,
32
32
} ;
33
33
34
- // root is the self-signed root of the trust chain, not an intermediate ca.
34
+ // ` root` is the self-signed root of the trust chain, not an intermediate ca.
35
35
function load ( cert , root ) {
36
- root = root || cert ; // Assume self-signed if no issuer
36
+ root = root || cert ; // Assume self-signed if no issuer.
37
37
const id = {
38
38
key : fixtures . readKey ( cert + '-key.pem' , 'binary' ) ,
39
39
cert : fixtures . readKey ( cert + '-cert.pem' , 'binary' ) ,
@@ -53,7 +53,7 @@ exports.connect = function connect(options, callback) {
53
53
tls . createServer ( options . server , function ( conn ) {
54
54
server . conn = conn ;
55
55
conn . pipe ( conn ) ;
56
- maybeCallback ( )
56
+ maybeCallback ( ) ;
57
57
} ) . listen ( 0 , function ( ) {
58
58
server . server = this ;
59
59
@@ -92,7 +92,7 @@ exports.connect = function connect(options, callback) {
92
92
function maybeCallback ( ) {
93
93
if ( ! callback )
94
94
return ;
95
- if ( server . conn && ( client . conn || client . err ) ) {
95
+ if ( server . conn && client . conn ) {
96
96
const err = pair . client . err || pair . server . err ;
97
97
callback ( err , pair , cleanup ) ;
98
98
callback = null ;
@@ -105,4 +105,4 @@ exports.connect = function connect(options, callback) {
105
105
if ( client . conn )
106
106
client . conn . end ( ) ;
107
107
}
108
- }
108
+ } ;
0 commit comments