Go ยท Stdlib Only ยท v1.0.0

CA Certificate Fetcher

Extract CA certificates from any TLS server. One command, zero dependencies, cross-platform binary.

โ†“ Download Binary โ–ถ Run on This Server
Why tls-ca-fetch
โš™๏ธ

Zero Dependencies

Pure Go stdlib โ€” no OpenSSL, no Python, no brew installs. Drop the single static binary anywhere and run it. Works on Linux, macOS, and Windows without any runtime or shared library.

๐Ÿ”—

Full Chain Inspection

Shows every certificate in the TLS chain: the leaf (server cert), any intermediate CAs, and the root CA if it's present. Each cert's role, issuer, expiry, and AIA URL are printed at a glance.

๐ŸŒ

AIA Root Fetch

Servers almost never send the root CA โ€” it's assumed to be in your OS trust store. With -fetch-root, tls-ca-fetch follows the AIA extension URL to download the root automatically.

Quick Usage

Drop the binary on your PATH and point it at any host.

shell
# Basic โ€” saves google.com-ca.pem
tls-ca-fetch google.com

# Custom port
tls-ca-fetch example.com 8443

# Fetch root CA via AIA URL
tls-ca-fetch -fetch-root example.com

# Private / self-signed server
tls-ca-fetch -insecure internal.corp 8443

# Save full chain (leaf + CAs)
tls-ca-fetch -all example.com
Example Output

Running against google.com โ€” shows the full chain with roles identified automatically.

terminal โ€” tls-ca-fetch google.com
โ†’ Connecting to google.com:443 โ€ฆ

Chain received: 3 certificate(s)
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  [0] leaf             CN=*.google.com                        IsCA=false
       Issuer : WR2
       Expires: 2026-06-22
       AIA    : http://i.pki.goog/wr2.crt

  [1] intermediate CA  CN=WR2                                 IsCA=true
       Issuer : GTS Root R1
       Expires: 2029-02-20

  [2] intermediate CA  CN=GTS Root R1                         IsCA=true
       Issuer : GlobalSign Root CA
       Expires: 2028-01-28
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

โœ“ Saved 2 CA certificates โ†’ google.com-ca.pem
  Verified: 2 PEM block(s) readable in output file
โ†“ Download Binary โ–ถ Run on This Server