11'use strict' ;
2- var common = require ( '../common' ) ;
3- var assert = require ( 'assert' ) ;
2+ const common = require ( '../common' ) ;
43
54if ( ! common . hasCrypto ) {
65 common . skip ( 'missing crypto' ) ;
76 return ;
87}
9- var tls = require ( 'tls' ) ;
8+ const assert = require ( 'assert' ) ;
9+ const tls = require ( 'tls' ) ;
1010
11- var exec = require ( 'child_process' ) . exec ;
12- var fs = require ( 'fs' ) ;
11+ const exec = require ( 'child_process' ) . exec ;
12+ const fs = require ( 'fs' ) ;
1313
14- var options = {
14+ const options = {
1515 key : fs . readFileSync ( common . fixturesDir + '/keys/agent2-key.pem' ) ,
1616 cert : fs . readFileSync ( common . fixturesDir + '/keys/agent2-cert.pem' ) ,
1717 ciphers : '-ALL:ECDHE-RSA-AES128-SHA256' ,
1818 ecdhCurve : 'prime256v1'
1919} ;
2020
21- var reply = 'I AM THE WALRUS' ; // something recognizable
21+ const reply = 'I AM THE WALRUS' ; // something recognizable
2222
23- var server = tls . createServer ( options , common . mustCall ( function ( conn ) {
23+ const server = tls . createServer ( options , common . mustCall ( function ( conn ) {
2424 conn . end ( reply ) ;
2525} ) ) ;
2626
2727server . listen ( 0 , '127.0.0.1' , common . mustCall ( function ( ) {
28- var cmd = '"' + common . opensslCli + '" s_client -cipher ' + options . ciphers +
28+ let cmd = '"' + common . opensslCli + '" s_client -cipher ' + options . ciphers +
2929 ` -connect 127.0.0.1:${ this . address ( ) . port } ` ;
3030
3131 // for the performance and stability issue in s_client on Windows
@@ -34,7 +34,7 @@ server.listen(0, '127.0.0.1', common.mustCall(function() {
3434
3535 exec ( cmd , common . mustCall ( function ( err , stdout , stderr ) {
3636 if ( err ) throw err ;
37- assert . notEqual ( stdout . indexOf ( reply ) , - 1 ) ;
37+ assert ( stdout . includes ( reply ) ) ;
3838 server . close ( ) ;
3939 } ) ) ;
4040} ) ) ;
0 commit comments