/ct:tls-opensslfrom ct
Diagnoses TLS handshake failures, cert chain issues, ACME challenges, OCSP stapling, mTLS, and keystore conversions using openssl CLI tools.
Ships in ct. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Concise operational pointers for diagnosing TLS handshake failures, cert chain problems, and ACME/OCSP/mTLS workflows from the CLI.
Assumes you already know that TLS is asymmetric handshake → symmetric session, and that certs bind a public key to a name. This skill covers the operational layer — the openssl flags, error codes, ACME mechanics, and diagnostic flow that models gloss over.
Load when the question is about:
s_clientDo NOT load for: explaining what HTTPS does, basic public-key crypto introductions, TLS-protocol-design discussions, picking between ssl libraries — those don't need this skill.
The single most useful debugging tool. Defaults are subtle and wrong.
openssl s_client -connect host:443 -servername host. Without -servername, hosts behind name-based vhosting return their default cert (typically the first one configured) — you'll debug the wrong cert. Modern openssl falls back to the -connect host, but always set -servername explicitly.</dev/null openssl s_client -connect host:443 -servername host 2>/dev/null — otherwise s_client hangs reading stdin. Pipe to openssl x509 -noout -dates to extract just the leaf dates.-showcerts prints every cert the server sent in presentation order (leaf → intermediates). Compare what the server sends vs what the chain actually requires.Verify return code: N (text) at the end. s_client does not abort on verify failure by default — add -verify_return_error to make it fail. Without that flag, a broken chain still appears to "work."-CAfile ca.pem to verify against a private CA. -CApath /path/to/hashed/dir for a directory of hashed CAs.-tls1_2 / -tls1_3 to constrain. -no_tls1_3 to negate. Mismatch shows up as "no protocols available" or "wrong version number."-cipher 'ECDHE-RSA-AES128-GCM-SHA256' for TLS 1.2 only. -ciphersuites TLS_AES_128_GCM_SHA256 for TLS 1.3 only — note these are separate flags; mixing throws a syntax error.-alpn h2,http/1.1. Server picks one and returns ALPN protocol: h2 in the output. Empty ALPN protocol: line = server did not negotiate (HTTP/1.1 default).-debug for raw hex dump of all bytes; -msg for parsed handshake messages (ClientHello, ServerHello, Certificate, ...). Use -msg first, escalate to -debug for byte-level.-starttls smtp|imap|pop3|ftp|xmpp issues the protocol-specific upgrade command before the handshake. Otherwise the server interprets ClientHello as application data.-cert client.pem -key client.key. If server requests a cert and you don't send one, output shows No client certificate CA names sent plus a handshake error.Verify return code: numbers correspond to X509_V_ERR_* in <openssl/x509_vfy.h>. Memorise these:
X509_V_OK — success.CERT_HAS_EXPIRED — leaf or chain cert past notAfter. Check with openssl x509 -noout -dates.DEPTH_ZERO_SELF_SIGNED_CERT — leaf is self-signed (no CA). Common in dev with no -CAfile.SELF_SIGNED_CERT_IN_CHAIN — root anchor not in trust store. Add the root via -CAfile.UNABLE_TO_GET_ISSUER_CERT_LOCALLY — server did not send the intermediate, and you don't have it locally. The single most common production misconfiguration. Fix on the server, not the client.UNABLE_TO_VERIFY_LEAF_SIGNATURE — chain doesn't reach a trust anchor at all. Usually missing intermediate + missing root.CERT_REVOKED — appears in OCSP/CRL paths.INVALID_PURPOSE — leaf's EKU doesn't include serverAuth (or clientAuth for mTLS).CERT_UNTRUSTED — root present but not flagged as trustworthy for this purpose.Full list defined at include/openssl/x509_vfy.h in the openssl repo (~105 codes).
# Full text dump
openssl x509 -in cert.pem -noout -text
# Subject/issuer/dates only
openssl x509 -in cert.pem -noout -subject -issuer -dates
# SHA-256 fingerprint (matches what browsers show)
openssl x509 -in cert.pem -noout -fingerprint -sha256
# SANs (the field that actually matters for hostname match)
openssl x509 -in cert.pem -noout -ext subjectAltName
# Public key
openssl x509 -in cert.pem -pubkey -noout
# Read remote leaf without saving file
openssl s_client -connect host:443 -servername host </dev/null 2>/dev/null \
| openssl x509 -noout -dates -subject -ext subjectAltName
CN is dead. Modern verifiers (Chrome, curl, Go since 1.15) ignore Common Name and use SAN exclusively. Always populate SAN; CN is for human display.
leaf + intermediate(s), NOT the root. The client already has the root in its trust store; sending the root wastes bytes and doesn't help.openssl verify -CAfile root.pem -untrusted intermediates.pem leaf.pem — exits 0 on success. -untrusted is the cert(s) to consider but not trust./etc/ssl/cert.pem)/etc/ssl/certs/ca-certificates.crt (managed by update-ca-certificates)/etc/pki/tls/certs/ca-bundle.crt (managed by update-ca-trust)/etc/ssl/certs/ca-certificates.crt (ca-certificates apk package)caIssuers URL) lets clients fetch missing intermediates. Only Chrome / Edge chase AIA. Firefox, curl, Go, Java, Python ssl do not. Symptom: site works in Chrome, fails everywhere else → server is missing the intermediate. Fix the server, never rely on AIA.# RSA 4096 (still common for compat)
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:4096 -out rsa.pem
# ECDSA P-256 (smaller, faster, modern default)
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out ec.pem
# Ed25519 (smallest, OpenSSL 1.1.1+; not all CAs accept yet)
openssl genpkey -algorithm ED25519 -out ed.pem
# CSR with proper SANs (CSR without SANs → modern clients reject)
openssl req -new -key rsa.pem -out csr.pem \
-subj "/CN=example.com" \
-addext "subjectAltName=DNS:example.com,DNS:www.example.com"
# Self-signed (dev only)
openssl req -x509 -days 365 -key rsa.pem -out cert.pem \
-subj "/CN=example.com" \
-addext "subjectAltName=DNS:example.com"
-addext is the modern way; the old -extensions + openssl.cnf dance is no longer needed in OpenSSL 1.1.1+.
openssl ciphers -V 'ECDHE+AESGCM:!aNULL'. -V shows hex / proto / Kx / Au / Enc / Mac columns.ECDHE-RSA-AES256-GCM-SHA384 (hyphen-separated, openssl-flavored)TLS_AES_256_GCM_SHA384 (underscore, IANA name)TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_AES_128_CCM_SHA256, TLS_AES_128_CCM_8_SHA256. Only AEAD; key exchange and auth are decoupled into separate extensions.openssl dhparam -out dh2048.pem 2048 only matters for legacy DHE-* suites on TLS 1.2. With TLS 1.3 + ECDHE the file is irrelevant. Logjam (2015) mitigated by ≥2048-bit groups.Three challenge types. Pick based on what you control.
/.well-known/acme-challenge/<TOKEN> over port 80. Validation server follows redirects to 443, but the initial request is plain HTTP. Cannot validate wildcards.acme-tls/1. Cert must contain the id-pe-acmeIdentifier extension (OID 1.3.6.1.5.5.7.1.31) with the SHA-256 hash of the key authorization. Useful when you can't open port 80 but can intercept ALPN on 443._acme-challenge.<DOMAIN> containing the base64url-encoded SHA-256 of the key authorization. Only challenge that supports wildcards (*.example.com).Hit these and you're locked out for a week. Memorise:
a.example.com and b.example.com share the bucket).Always test on staging first: https://acme-staging-v02.api.letsencrypt.org/directory — same protocol, vastly higher limits, certs are not publicly trusted. Production: https://acme-v02.api.letsencrypt.org/directory.
Cert lifetime: 90 days. Convention: renew at 30 days remaining (60 days post-issue).
openssl ocsp -issuer issuer.pem -cert leaf.pem \
-url http://r3.o.lencr.org -resp_text -no_nonce -CAfile root.pem
-no_nonce is needed because most production responders return cached responses and reject nonce extensions.status_request extension. Client trusts the staple (signed by the CA) — no direct client→CA query.openssl s_client -connect host:443 -servername host -status </dev/null and look for OCSP response: block. Empty = server isn't stapling.ssl_stapling on; ssl_stapling_verify on; resolver 1.1.1.1 valid=300s; ssl_trusted_certificate chain.pem;SSLUseStapling on; SSLStaplingCache shmcb:/var/run/ocsp(128000);status_request TLS feature extension means clients MUST reject the handshake if no OCSP response is stapled. Once enabled, stapling failure breaks the site for compliant clients (Firefox, some Chrome paths). Don't enable until stapling is rock-solid.ServerHello is encrypted. Wireshark without keylog file shows opaque bytes — set SSLKEYLOGFILE=/path/to/keylog env for curl/Chrome to dump session keys.ssl_verify_client on; ssl_client_certificate ca-bundle.pem;. Apache: SSLVerifyClient require; SSLCACertificateFile ca-bundle.pem;.curl --cert client.pem --key client.key https://api.internal/
openssl s_client -connect api.internal:443 -servername api.internal \
-cert client.pem -key client.key
clientAuth (OID 1.3.6.1.5.5.7.3.2), not serverAuth. CAs sometimes issue with both; check via openssl x509 -noout -ext extendedKeyUsage.-----BEGIN ...----- markers. Default for openssl..p12 / .pfx = bundle of key + cert chain in one password-protected file. Windows / Java / iOS native format.# PEM cert → DER
openssl x509 -in cert.pem -outform DER -out cert.der
# PEM key + chain → PKCS#12
openssl pkcs12 -export -in cert.pem -inkey key.pem \
-certfile chain.pem -name myalias -out bundle.p12
# PKCS#12 → PEM (key + cert in one file, unencrypted key)
openssl pkcs12 -in bundle.p12 -nodes -out cert+key.pem
# OpenSSL 3.0+: -nodes is deprecated; use -noenc instead.
# PKCS#12 → JKS (via keytool)
keytool -importkeystore -srckeystore bundle.p12 -srcstoretype PKCS12 \
-destkeystore store.jks -deststoretype JKS
# JKS → PKCS#12
keytool -importkeystore -srckeystore store.jks \
-destkeystore bundle.p12 -deststoretype PKCS12
-nodes / -noenc means "no DES encryption on the private key" — required when the consumer (Nginx, HAProxy) reads the file directly. Without it, the key file is itself encrypted with a password.
Step through in order; the failure mode tells you the layer.
telnet host 443 / nc -vz host 443 — pure TCP.
openssl s_client -connect host:443 -servername host </dev/null with no version flags.
-tls1_2 then -tls1_3 to find what the server speaks.-cipher to bisect.Verify return code ≠ 0 → see X509_V_ERR section above.-showcerts — dump the chain. Compare leaf SAN to the hostname. Compare what's served vs what the chain requires. Missing intermediate = #20 verify error.-status — is OCSP stapling working? Check expiry of stapled response (responder might be down).-alpn h2,http/1.1 — negotiated protocol matches what the client expects?curl -vvv https://host/ — different stack, different trust store. If s_client works and curl doesn't, the system trust store is suspect.testssl.sh host — comprehensive third-party check; flags vulns, weak ciphers, cert problems in one report.Common failure → likely cause:
notAfter; check renewal cron / certbot timer.-servername matches what the client sends.-servername in your test).1.3.6.1.4.1.11129.2.4.2), or via OCSP stapling extension (OID 1.3.6.1.4.1.11129.2.4.5), or as a TLS extension. Most CAs use embedded.crt.sh indexes all public CT logs. Useful for finding shadow IT, expired-but-still-served certs, or unauthorized issuance.openssl x509 -in cert.pem -noout -text — look for "CT Precertificate SCTs" block.testssl.sh — bash script, comprehensive cipher/cert/vuln scan. Best single-shot audit tool.mkcert (filippo.io/mkcert) — local CA for development; auto-installs into OS + browser trust stores. Use this instead of self-signed certs in dev.step-cli (Smallstep) — saner ACME client + PKI tooling than openssl for many workflows. step certificate inspect beats openssl x509 -text.cfssl (Cloudflare) — JSON-driven CSR/cert generation; good for automation.ssllabs.com/ssltest) — public-facing scan with grade. Slow but authoritative.OpenSSL manpages (docs.openssl.org/master/man1/):
RFCs (datatracker.ietf.org):
Let's Encrypt:
Reliable operational deep-dives:
Before recommending a non-trivial TLS change (cipher policy, ACME automation, OCSP must-staple, mTLS rollout):
openssl s_client -connect host:443 -servername host -verify_return_error </dev/null end-to-end and reading Verify return code: 0 (ok).Tuning without measurement is worse than defaults.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tls-debugging, openssl, certificate-validation, acme, ocsp, mtls
npx claudepluginhub pvillega/claude-templates --plugin ct38 skills in this plugin
/argocdDeep ArgoCD operational intuition — sync waves and hook lifecycle, ApplicationSet generators, Sync vs Health, drift root causes, sync options, AppProject constraints, rollback, multi-cluster. Load for sync ordering, hook design, drift diagnosis, generator selection, rollback planning, or multi-cluster registration. Skip for "what is GitOps", install walkthroughs, or basic Application YAML. Triggers on: "sync wave", "presync hook", "syncfail", "applicationset generator", "matrix generator", "hpa replicas drift", "ignoreDifferences", "ServerSideApply", "Replace=true", "self-heal", "app-of-apps cascade".
/audit-skillsAudit installed skills for redundancy with built-in model knowledge. Use when asked to "audit skills", "review my skills", "check skill redundancy", "which skills are useful", "clean up skills", or "are my skills teaching you anything new"./Other plugins' skills for the same job