src: suggest --use-system-ca when a certificate error occurs

PR-URL: https://github.com/nodejs/node/pull/57362
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
Aditi authored and RafaelGSS committed 2025-05-02 17:05:10 -03:00
1 parent a0182f1f12
commit cfe643f3ca
7 files changed
+34 -17

No files matched your search

@@ -17,7 +17,7 @@ const options = {
const expectedHeader = /^HTTP\/1\.1 200 OK/;
const expectedBody = /hello world\n/;
const expectCertError = /^Error: unable to verify the first certificate$/;
const expectCertError = /^UNABLE_TO_VERIFY_LEAF_SIGNATURE$/;
const checkRequest = (socket, server) => {
let result = '';
@@ -112,7 +112,7 @@ function createServer() {
const options = null;
const socket = agent.createConnection(port, host, options);
socket.on('error', common.mustCall((e) => {
assert.match(e.toString(), expectCertError);
assert.match(e.code, expectCertError);
server.close();
}));
}));
@@ -127,7 +127,7 @@ function createServer() {
const options = undefined;
const socket = agent.createConnection(port, host, options);
socket.on('error', common.mustCall((e) => {
assert.match(e.toString(), expectCertError);
assert.match(e.code, expectCertError);
server.close();
}));
}));