@authoritydmc/trust-cert
v1.0.0
Published
Zero-dependency CLI to inspect, extract, and auto-install TLS/SSL certificates and root CAs into Windows, macOS, and Linux trust stores.
Maintainers
Readme
@authoritydmc/trust-cert
Zero-dependency CLI to inspect, extract, and auto-install TLS/SSL certificates and root CAs directly into Windows, macOS, and Linux OS trust stores.
⚡ Instant Run via npx
No installation needed. Run directly from your terminal:
# Inspect and install the root CA / cert for any website or local server:
npx @authoritydmc/trust-cert https://rajlab.lan
# Auto-confirm and install without interactive prompt:
npx @authoritydmc/trust-cert https://rajlab.lan --yes
# Export the extracted certificate to disk:
npx @authoritydmc/trust-cert https://rajlab.lan --out ./lab-ca.crt
# Windows (User store only, no admin privilege prompt):
npx @authoritydmc/trust-cert https://rajlab.lan --user🚀 Key Features
- Zero External Dependencies: Built with 100% native Node.js APIs (
tls,crypto,child_process,fs). Runs instantaneously throughnpxwith zero package download bloat. - Automatic Chain Traversal: Automatically traverses the TLS certificate hierarchy to identify the Root / Intermediate CA (Trust Anchor) rather than just trusting an ephemeral leaf certificate.
- Cross-Platform Auto-Installation:
- Windows: Automatically invokes
certutil -addstore Root <cert>(or-user Root). - macOS: Automatically invokes
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain. - Linux (Ubuntu / Debian): Copies to
/usr/local/share/ca-certificates/and runsupdate-ca-certificates. - Linux (RHEL / Fedora / CentOS): Copies to
/etc/pki/ca-trust/source/anchors/and runsupdate-ca-trust. - Linux (Arch): Runs
trust anchor.
- Windows: Automatically invokes
- Smart DNS & Local IP Fallback: If connecting to
.lanor.localdomains before local DNS is populated, automatically attempts LAN IP fallbacks while preserving the TLS SNI header. - Safe & Transparent: Prints the full certificate summary (Subject, Issuer, Validity, SHA-256 fingerprint, SANs) and asks for user confirmation before touching the OS trust store.
📦 How to Publish to npm
- Log in to npm:
npm login - Publish the package (public scoped package):
cd packages/trust-cert npm publish --access public - Once published, anyone can run:
npx @authoritydmc/trust-cert https://your-server.lan
📄 License
MIT © Raj Dubey (RajLabs)
