@@ -4,13 +4,12 @@ if (!common.hasCrypto)
4
4
common . skip ( 'missing crypto' ) ;
5
5
6
6
const assert = require ( 'assert' ) ;
7
+ const fixtures = require ( '../common/fixtures' ) ;
7
8
const https = require ( 'https' ) ;
8
- const fs = require ( 'fs' ) ;
9
- const path = require ( 'path' ) ;
10
9
11
10
const 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')
14
13
} ;
15
14
16
15
const server = https . createServer ( options , common . mustCall ( function ( req , res ) {
@@ -25,7 +24,7 @@ function authorized() {
25
24
const req = https . request ( {
26
25
port : server . address ( ) . port ,
27
26
rejectUnauthorized : true ,
28
- ca : [ fs . readFileSync ( path . join ( common . fixturesDir , 'keys/ ca2-cert.pem') ) ]
27
+ ca : [ fixtures . readKey ( ' ca2-cert.pem') ]
29
28
} , common . mustNotCall ( ) ) ;
30
29
req . on ( 'error' , function ( err ) {
31
30
override ( ) ;
@@ -37,7 +36,7 @@ function override() {
37
36
const options = {
38
37
port : server . address ( ) . port ,
39
38
rejectUnauthorized : true ,
40
- ca : [ fs . readFileSync ( path . join ( common . fixturesDir , 'keys/ ca2-cert.pem') ) ] ,
39
+ ca : [ fixtures . readKey ( ' ca2-cert.pem') ] ,
41
40
checkServerIdentity : function ( host , cert ) {
42
41
return false ;
43
42
}
0 commit comments