@@ -4,13 +4,12 @@ if (!common.hasCrypto)
44 common . skip ( 'missing crypto' ) ;
55
66const assert = require ( 'assert' ) ;
7+ const fixtures = require ( '../common/fixtures' ) ;
78const https = require ( 'https' ) ;
8- const fs = require ( 'fs' ) ;
9- const path = require ( 'path' ) ;
109
1110const options = {
12- key : fs . readFileSync ( path . join ( common . fixturesDir , 'keys/ agent3-key.pem') ) ,
13- cert : fs . readFileSync ( path . join ( common . fixturesDir , 'keys/ agent3-cert.pem') )
11+ key : fixtures . readKey ( ' agent3-key.pem') ,
12+ cert : fixtures . readKey ( ' agent3-cert.pem')
1413} ;
1514
1615const server = https . createServer ( options , common . mustCall ( function ( req , res ) {
@@ -25,7 +24,7 @@ function authorized() {
2524 const req = https . request ( {
2625 port : server . address ( ) . port ,
2726 rejectUnauthorized : true ,
28- ca : [ fs . readFileSync ( path . join ( common . fixturesDir , 'keys/ ca2-cert.pem') ) ]
27+ ca : [ fixtures . readKey ( ' ca2-cert.pem') ]
2928 } , common . mustNotCall ( ) ) ;
3029 req . on ( 'error' , function ( err ) {
3130 override ( ) ;
@@ -37,7 +36,7 @@ function override() {
3736 const options = {
3837 port : server . address ( ) . port ,
3938 rejectUnauthorized : true ,
40- ca : [ fs . readFileSync ( path . join ( common . fixturesDir , 'keys/ ca2-cert.pem') ) ] ,
39+ ca : [ fixtures . readKey ( ' ca2-cert.pem') ] ,
4140 checkServerIdentity : function ( host , cert ) {
4241 return false ;
4342 }
0 commit comments