Skip to content

Commit 6c55f8a

Browse files
committed
test(node:http): change the default CA list inside the try that restores it
1 parent d5e6c4c commit 6c55f8a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎test/js/node/http/node-http-proxy-url.node.mts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,11 @@ describe(
328328
for (const { name, scheme, createProxy, trusted } of routes) {
329329
test(name, async () => {
330330
const defaults = trusted ? tls.getCACertificates("default") : undefined;
331-
if (defaults) tls.setDefaultCACertificates([...defaults, cert]);
332331
const proxy = createProxy();
333332
const agent = proxiedAgent(`${scheme}://127.0.0.1:${await listenOnRandomPort(proxy)}`);
334333
const turns = countTurns(agent);
335334
try {
335+
if (defaults) tls.setDefaultCACertificates([...defaults, cert]);
336336
const req = https.get({ ...target, agent });
337337
const ticks = turnsOf(req, turns);
338338
assert.deepStrictEqual(

0 commit comments

Comments
 (0)