@@ -25,13 +25,12 @@ if (!common.hasCrypto)
2525 common . skip ( 'missing crypto' ) ;
2626
2727const assert = require ( 'assert' ) ;
28+ const fixtures = require ( '../common/fixtures' ) ;
2829const https = require ( 'https' ) ;
29- const fs = require ( 'fs' ) ;
30- const path = require ( 'path' ) ;
3130
3231const options = {
33- key : fs . readFileSync ( path . join ( common . fixturesDir , 'keys/ agent3-key.pem') ) ,
34- cert : fs . readFileSync ( path . join ( common . fixturesDir , 'keys/ agent3-cert.pem') )
32+ key : fixtures . readKey ( ' agent3-key.pem') ,
33+ cert : fixtures . readKey ( ' agent3-cert.pem')
3534} ;
3635
3736const server = https . createServer ( options , common . mustCall ( function ( req , res ) {
@@ -46,7 +45,7 @@ function authorized() {
4645 const req = https . request ( {
4746 port : server . address ( ) . port ,
4847 rejectUnauthorized : true ,
49- ca : [ fs . readFileSync ( path . join ( common . fixturesDir , 'keys/ ca2-cert.pem') ) ]
48+ ca : [ fixtures . readKey ( ' ca2-cert.pem') ]
5049 } , common . mustNotCall ( ) ) ;
5150 req . on ( 'error' , function ( err ) {
5251 override ( ) ;
@@ -58,7 +57,7 @@ function override() {
5857 const options = {
5958 port : server . address ( ) . port ,
6059 rejectUnauthorized : true ,
61- ca : [ fs . readFileSync ( path . join ( common . fixturesDir , 'keys/ ca2-cert.pem') ) ] ,
60+ ca : [ fixtures . readKey ( ' ca2-cert.pem') ] ,
6261 checkServerIdentity : function ( host , cert ) {
6362 return false ;
6463 }
0 commit comments