@@ -36,8 +36,8 @@ afterAll(() => {
36
36
async function startServer ( certName : string ) : Promise < string > {
37
37
const server = https . createServer (
38
38
{
39
- key : await fs . readFile ( path . join ( __dirname , `../fixtures/${ certName } .key` ) ) ,
40
- cert : await fs . readFile ( path . join ( __dirname , `../fixtures/${ certName } .crt` ) ) ,
39
+ key : await fs . readFile ( path . join ( __dirname , `../fixtures/tls/ ${ certName } .key` ) ) ,
40
+ cert : await fs . readFile ( path . join ( __dirname , `../fixtures/tls/ ${ certName } .crt` ) ) ,
41
41
} ,
42
42
( req , res ) => {
43
43
if ( req . url ?. endsWith ( "/error" ) ) {
@@ -71,7 +71,7 @@ it("detects partial chains", async () => {
71
71
const address = await startServer ( "chain-leaf" )
72
72
const request = axios . get ( address , {
73
73
httpsAgent : new https . Agent ( {
74
- ca : await fs . readFile ( path . join ( __dirname , "../fixtures/chain-leaf.crt" ) ) ,
74
+ ca : await fs . readFile ( path . join ( __dirname , "../fixtures/tls/ chain-leaf.crt" ) ) ,
75
75
} ) ,
76
76
} )
77
77
await expect ( request ) . rejects . toHaveProperty ( "code" , X509_ERR_CODE . UNABLE_TO_VERIFY_LEAF_SIGNATURE )
@@ -101,7 +101,7 @@ it("detects self-signed certificates without signing capability", async () => {
101
101
const address = await startServer ( "no-signing" )
102
102
const request = axios . get ( address , {
103
103
httpsAgent : new https . Agent ( {
104
- ca : await fs . readFile ( path . join ( __dirname , "../fixtures/no-signing.crt" ) ) ,
104
+ ca : await fs . readFile ( path . join ( __dirname , "../fixtures/tls/ no-signing.crt" ) ) ,
105
105
servername : "localhost" ,
106
106
} ) ,
107
107
} )
@@ -150,7 +150,7 @@ it("is ok with trusted self-signed certificates", async () => {
150
150
const address = await startServer ( "self-signed" )
151
151
const request = axios . get ( address , {
152
152
httpsAgent : new https . Agent ( {
153
- ca : await fs . readFile ( path . join ( __dirname , "../fixtures/self-signed.crt" ) ) ,
153
+ ca : await fs . readFile ( path . join ( __dirname , "../fixtures/tls/ self-signed.crt" ) ) ,
154
154
servername : "localhost" ,
155
155
} ) ,
156
156
} )
@@ -188,7 +188,7 @@ it("is ok with chains with a trusted root", async () => {
188
188
const address = await startServer ( "chain" )
189
189
const request = axios . get ( address , {
190
190
httpsAgent : new https . Agent ( {
191
- ca : await fs . readFile ( path . join ( __dirname , "../fixtures/chain-root.crt" ) ) ,
191
+ ca : await fs . readFile ( path . join ( __dirname , "../fixtures/tls/ chain-root.crt" ) ) ,
192
192
servername : "localhost" ,
193
193
} ) ,
194
194
} )
@@ -209,7 +209,7 @@ it("falls back with different error", async () => {
209
209
const address = await startServer ( "chain" )
210
210
const request = axios . get ( address + "/error" , {
211
211
httpsAgent : new https . Agent ( {
212
- ca : await fs . readFile ( path . join ( __dirname , "../fixtures/chain-root.crt" ) ) ,
212
+ ca : await fs . readFile ( path . join ( __dirname , "../fixtures/tls/ chain-root.crt" ) ) ,
213
213
servername : "localhost" ,
214
214
} ) ,
215
215
} )
0 commit comments