@vigilbase/cli
Version:
Vigilbase CLI — security scanners, agent tools, and Vigilbase One from the terminal.
17 lines (16 loc) • 646 B
JavaScript
import * as tls from 'node:tls';
let isConfigured = false;
/** CLI startup only: preserve bundled/extra CAs and add OS-managed trust. */
export function configureSystemTrust(api = tls) {
if (!api.getCACertificates || !api.setDefaultCACertificates)
return false;
api.setDefaultCACertificates([
...new Set([...api.getCACertificates('default'), ...api.getCACertificates('system')]),
]);
isConfigured = true;
return true;
}
/** Whether configureSystemTrust added the OS certificates; TLS advice suggests a newer Node only when it couldn't. */
export function isSystemTrustConfigured() {
return isConfigured;
}