@@ -18,7 +18,7 @@ exports.debug = util.debuglog('test');
1818exports . tls = tls ;
1919
2020// Pre-load keys from common fixtures for ease of use by tests.
21- const keys = exports . keys = {
21+ exports . keys = {
2222 agent1 : load ( 'agent1' , 'ca1' ) ,
2323 agent2 : load ( 'agent2' , 'agent2' ) ,
2424 agent3 : load ( 'agent3' , 'ca2' ) ,
@@ -31,9 +31,9 @@ const keys = exports.keys = {
3131 ec : load ( 'ec' , 'ec' ) ,
3232} ;
3333
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.
3535function load ( cert , root ) {
36- root = root || cert ; // Assume self-signed if no issuer
36+ root = root || cert ; // Assume self-signed if no issuer.
3737 const id = {
3838 key : fixtures . readKey ( cert + '-key.pem' , 'binary' ) ,
3939 cert : fixtures . readKey ( cert + '-cert.pem' , 'binary' ) ,
@@ -53,7 +53,7 @@ exports.connect = function connect(options, callback) {
5353 tls . createServer ( options . server , function ( conn ) {
5454 server . conn = conn ;
5555 conn . pipe ( conn ) ;
56- maybeCallback ( )
56+ maybeCallback ( ) ;
5757 } ) . listen ( 0 , function ( ) {
5858 server . server = this ;
5959
@@ -92,7 +92,7 @@ exports.connect = function connect(options, callback) {
9292 function maybeCallback ( ) {
9393 if ( ! callback )
9494 return ;
95- if ( server . conn && ( client . conn || client . err ) ) {
95+ if ( server . conn && client . conn ) {
9696 const err = pair . client . err || pair . server . err ;
9797 callback ( err , pair , cleanup ) ;
9898 callback = null ;
@@ -105,4 +105,4 @@ exports.connect = function connect(options, callback) {
105105 if ( client . conn )
106106 client . conn . end ( ) ;
107107 }
108- }
108+ } ;
0 commit comments