@@ -25,13 +25,12 @@ if (!common.hasCrypto)
25
25
common . skip ( 'missing crypto' ) ;
26
26
27
27
const assert = require ( 'assert' ) ;
28
+ const fixtures = require ( '../common/fixtures' ) ;
28
29
const https = require ( 'https' ) ;
29
- const fs = require ( 'fs' ) ;
30
- const path = require ( 'path' ) ;
31
30
32
31
const 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')
35
34
} ;
36
35
37
36
const server = https . createServer ( options , common . mustCall ( function ( req , res ) {
@@ -46,7 +45,7 @@ function authorized() {
46
45
const req = https . request ( {
47
46
port : server . address ( ) . port ,
48
47
rejectUnauthorized : true ,
49
- ca : [ fs . readFileSync ( path . join ( common . fixturesDir , 'keys/ ca2-cert.pem') ) ]
48
+ ca : [ fixtures . readKey ( ' ca2-cert.pem') ]
50
49
} , common . mustNotCall ( ) ) ;
51
50
req . on ( 'error' , function ( err ) {
52
51
override ( ) ;
@@ -58,7 +57,7 @@ function override() {
58
57
const options = {
59
58
port : server . address ( ) . port ,
60
59
rejectUnauthorized : true ,
61
- ca : [ fs . readFileSync ( path . join ( common . fixturesDir , 'keys/ ca2-cert.pem') ) ] ,
60
+ ca : [ fixtures . readKey ( ' ca2-cert.pem') ] ,
62
61
checkServerIdentity : function ( host , cert ) {
63
62
return false ;
64
63
}
0 commit comments