11import { describe , expect , test } from "vitest"
22import { createEnvironment , Environment } from "../../src/environment.js"
3- import {
4- host ,
5- username ,
6- eventually ,
7- numberOfConnections ,
8- password ,
9- } from "../support/util.js"
3+ import { host , username , eventually , numberOfConnections , password } from "../support/util.js"
104import { Connection } from "../../src/connection.js"
115import { readFile } from "fs/promises"
126
@@ -15,11 +9,12 @@ describe("TLS Connection", () => {
159 let connection : Connection
1610
1711 test ( "creating a TLS connection" , async ( ) => {
12+ const cn = process . env . CN ?? "rabbitmq"
1813 const tls = {
1914 ca : await readFile ( "./tls-gen/basic/result/ca_certificate.pem" , "utf8" ) ,
20- cert : await readFile ( `./tls-gen/basic/result/client_rabbitmq_certificate .pem` , "utf8" ) ,
21- key : await readFile ( `./tls-gen/basic/result/client_rabbitmq_key .pem` , "utf8" ) ,
22- rejectUnauthorized : true
15+ cert : await readFile ( `./tls-gen/basic/result/client_ ${ cn } _certificate .pem` , "utf8" ) ,
16+ key : await readFile ( `./tls-gen/basic/result/client_ ${ cn } _key .pem` , "utf8" ) ,
17+ rejectUnauthorized : true ,
2318 }
2419
2520 environment = createEnvironment ( { host, port : 5671 , username, password, tls } )
0 commit comments