Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Configure TLS certificates and encryption for secure communications. Use when setting up HTTPS, securing service-to-service connections, implementing mutual TLS (mTLS), or debugging certificate issues.
.claude/skills/ancoleman-implementing-tls/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-15 | ✗→✓ | ▲ Improved | 197% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 240% | 0% |
| case-21 | ✓→✗ | ▼ Worse | 279% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 210% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 219% | 0% |
Implement Transport Layer Security (TLS) for encrypting network communications and authenticating services. Generate certificates, automate certificate lifecycle management with Let's Encrypt or internal CAs, configure TLS 1.3, implement mutual TLS for service authentication, and debug common certificate issues.
Trigger this skill when:
Use mkcert for trusted local certificates:
bash# Install mkcert brew install mkcert # macOS # sudo apt install mkcert # Linux # Install local CA mkcert -install # Generate certificate mkcert example.com localhost 127.0.0.1 # Creates: example.com+2.pem and example.com+2-key.pem
Kubernetes with cert-manager:
bash# Install cert-manager helm install cert-manager jetstack/cert-manager \ --namespace cert-manager --create-namespace \ --set installCRDs=true # Create Let's Encrypt issuer kubectl apply -f - <<EOF apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: letsencrypt-prod spec: acme: server: https://acme-v02.api.letsencrypt.org/directory email: admin@example.com privateKeySecretRef: name: letsencrypt-prod-key solvers: - http01: ingress: class: nginx EOF
Traditional servers with Certbot:
bash# Install certbot sudo apt install certbot # Obtain certificate sudo certbot certonly --standalone -d example.com -d www.example.com # Certificates saved to /etc/letsencrypt/live/example.com/
Generate internal CA with CFSSL:
bash# Install CFSSL brew install cfssl # macOS # Create CA cfssl genkey -initca ca-csr.json | cfssljson -bare ca # Generate server certificate cfssl gencert -ca=ca.pem -ca-key=ca-key.pem \ -config=ca-config.json -profile=server \ server-csr.json | cfssljson -bare server
See examples/cfssl-ca/ for complete configuration files.
Enable TLS 1.3 and 1.2 only:
nginx# Nginx ssl_protocols TLSv1.3 TLSv1.2; ssl_prefer_server_ciphers off; # Let client choose
Disable obsolete protocols: SSLv3, TLS 1.0, TLS 1.1.
TLS 1.3 (5 cipher suites):
TLS_AES_256_GCM_SHA384 # Recommended
TLS_CHACHA20_POLY1305_SHA256 # Mobile-optimized
TLS_AES_128_GCM_SHA256 # PerformanceTLS 1.2 fallback:
nginxssl_ciphers 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-CHACHA20-POLY1305';
Strict-Transport-Security headerFor detailed TLS 1.3 configuration, see references/tls13-best-practices.md.
Need TLS certificate?
│
├─ Public-facing (internet users)?
│ │
│ ├─ Single domain → Let's Encrypt with HTTP-01
│ │ Tools: certbot, cert-manager
│ │ Challenge: HTTP verification
│ │
│ └─ Multiple subdomains → Let's Encrypt with DNS-01
│ Tools: certbot with DNS plugin, cert-manager
│ Challenge: DNS TXT records
│ Supports: Wildcard certificates (*.example.com)
│
└─ Internal (corporate network)?
│
├─ Development → mkcert or self-signed
│ Tools: mkcert (trusted), openssl (basic)
│ No automation needed
│
└─ Production → Internal CA
│
├─ Small scale (<10 services) → CFSSL
│ Manual management acceptable
│
└─ Large scale (100+ services) → Vault PKI or cert-manager
Dynamic secrets, automatic rotationEnvironment?
│
├─ Kubernetes → cert-manager
│ Native CRDs, Ingress integration
│ Supports: Let's Encrypt, Vault, CA, self-signed
│
├─ Traditional servers (VMs) → Certbot (public) or CFSSL (internal)
│ Plugins: nginx, apache, DNS providers
│ Automated renewal via cron/systemd
│
├─ Microservices (any platform) → HashiCorp Vault PKI
│ Dynamic secrets, short-lived certs
│ API-driven, service mesh integration
│
└─ Developer workstation → mkcert
Trusted by browser automaticallyUse Standard TLS (server-only authentication) when:
Use Mutual TLS (both authenticate) when:
See references/mtls-guide.md for mTLS implementation patterns.
Quick generation with SANs:
bash# Create OpenSSL config cat > san.cnf <<EOF [req] default_bits = 2048 prompt = no default_md = sha256 distinguished_name = dn req_extensions = v3_req [dn] CN = example.com [v3_req] subjectAltName = @alt_names [alt_names] DNS.1 = example.com DNS.2 = www.example.com DNS.3 = api.example.com IP.1 = 192.168.1.100 EOF # Generate key and certificate openssl req -x509 -newkey rsa:2048 -nodes \ -keyout server-key.pem -out server-cert.pem \ -days 365 -config san.cnf -extensions v3_req # Verify SANs openssl x509 -in server-cert.pem -noout -text | grep -A 3 "Subject Alternative Name"
For detailed examples including CFSSL and mkcert, see references/certificate-generation.md and examples/self-signed/.
With Certbot (traditional servers):
bash# Standalone mode (port 80 must be free) sudo certbot certonly --standalone -d example.com -d www.example.com # Webroot mode (no service interruption) sudo certbot certonly --webroot -w /var/www/html -d example.com # DNS challenge (wildcard support) sudo certbot certonly --manual --preferred-challenges dns \ -d example.com -d "*.example.com" # Test renewal sudo certbot renew --dry-run
With cert-manager (Kubernetes):
yaml# Ingress with automatic certificate apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: example-ingress annotations: cert-manager.io/cluster-issuer: "letsencrypt-prod" spec: tls: - hosts: - example.com secretName: example-com-tls rules: - host: example.com http: paths: - path: / pathType: Prefix backend: service: name: web-service port: number: 80
See references/automation-patterns.md for complete automation guides.
Server configuration (Nginx):
nginxserver { listen 443 ssl; server_name api.example.com; # Server certificate ssl_certificate /etc/ssl/certs/server.crt; ssl_certificate_key /etc/ssl/private/server.key; # CA to verify client certificates ssl_client_certificate /etc/ssl/certs/ca.crt; ssl_verify_client on; ssl_verify_depth 2; # TLS 1.3 ssl_protocols TLSv1.3; location / { proxy_pass http://backend; # Pass client cert info to backend proxy_set_header X-SSL-Client-Cert $ssl_client_cert; proxy_set_header X-SSL-Client-S-DN $ssl_client_s_dn; } }
Client request with certificate:
bashcurl https://api.example.com/endpoint \ --cert client.crt \ --key client.key \ --cacert ca.crt
See references/mtls-guide.md and examples/mtls-nginx/ for complete mTLS implementations.
Test TLS connection:
bash# Basic connection test openssl s_client -connect example.com:443 # Show certificate chain openssl s_client -connect example.com:443 -showcerts # Test specific TLS version openssl s_client -connect example.com:443 -tls1_3 # Test with client certificate (mTLS) openssl s_client -connect api.example.com:443 \ -cert client.crt -key client.key -CAfile ca.crt
Examine certificate:
bash# View certificate details openssl x509 -in cert.pem -noout -text # Check expiration openssl x509 -in cert.pem -noout -dates # Check Subject Alternative Names openssl x509 -in cert.pem -noout -text | grep -A 1 "Subject Alternative Name" # Verify certificate chain openssl verify -CAfile ca.crt cert.pem
Verify key and certificate match:
bash# Certificate modulus openssl x509 -in cert.pem -noout -modulus | md5sum # Key modulus (must match) openssl rsa -in key.pem -noout -modulus | md5sum
Common errors and solutions:
| Error | Cause | Solution | |-------|-------|----------| | certificate has expired | Certificate validity passed | Renew certificate, check system clock | | unable to get local issuer certificate | CA not in trust store | Add CA cert to system trust store | | Hostname mismatch | CN/SAN doesn't match hostname | Regenerate cert with correct SANs | | handshake failure | TLS version/cipher mismatch | Enable TLS 1.2+, check cipher suites | | certificate signed by unknown authority | Missing intermediate certs | Include full chain in server config |
See references/debugging-tls.md for comprehensive troubleshooting guide.
| Use Case | Environment | Recommended Tool | Alternative | |----------|-------------|------------------|-------------| | Public HTTPS | Kubernetes | cert-manager | External Secrets Operator | | Public HTTPS | VMs/Bare Metal | Certbot | acme.sh | | Internal PKI | Any | HashiCorp Vault | CFSSL, Smallstep | | mTLS (K8s) | Kubernetes | cert-manager + Istio | Linkerd, Consul | | mTLS (VMs) | Traditional | Vault PKI | CFSSL | | Local Dev | Workstation | mkcert | Self-signed (OpenSSL) | | Debugging | Any | OpenSSL s_client | curl -v | | Automation | CI/CD | CFSSL API | Vault API |
1. Generate
├─ Development: mkcert, self-signed (OpenSSL)
├─ Production: Let's Encrypt, commercial CA
└─ Internal: CFSSL, Vault PKI
2. Deploy
├─ Kubernetes: Mount as Secret volume
├─ VMs: Copy to /etc/ssl/ or application directory
└─ Containers: Mount via Docker volumes
3. Monitor
├─ Check expiry: openssl x509 -noout -dates
├─ Prometheus: blackbox_exporter (probe_ssl_earliest_cert_expiry)
└─ Alert: < 7 days before expiry
4. Renew
├─ Automated: certbot renew, cert-manager, Vault Agent
├─ Manual: Generate new CSR, reissue from CA
└─ Timing: Renew 30 days before expiry
5. Rotate
├─ Zero-downtime: Load new cert, graceful reload
├─ Kubernetes: Update Secret, rolling restart
└─ Service mesh: Automatic rotation (Istio, Linkerd)PEM (most common):
DER (binary):
PKCS#12 / PFX (container):
Convert formats:
bash# PEM to DER openssl x509 -in cert.pem -outform DER -out cert.der # PEM to PKCS#12 openssl pkcs12 -export -out cert.p12 -inkey key.pem -in cert.pem # PKCS#12 to PEM openssl pkcs12 -in cert.p12 -out cert.pem -nodes
See scripts/convert-formats.sh for automated conversion.
Security and Authentication:
Infrastructure:
Operations:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 9,982 | 7,236 | -28% | 1 | 1 | 0% | 1,655 | 5,132 | +210% | 0 | 0 | — |
case-02 | pass→pass | 8,813 | 5,960 | -32% | 1 | 1 | 0% | 1,580 | 5,039 | +219% | 0 | 0 | — |
case-03 | pass→pass | 9,686 | 8,605 | -11% | 1 | 1 | 0% | 1,813 | 5,632 | +211% | 0 | 0 | — |
case-04 | pass→pass | 13,229 | 16,503 | +25% | 1 | 1 | 0% | 2,243 | 5,759 | +157% | 0 | 0 | — |
case-05 | pass→pass | 18,949 | 16,748 | -12% | 1 | 1 | 0% | 3,025 | 6,654 | +120% | 0 | 0 | — |
case-06 | pass→pass | 6,640 | 6,028 | -9% | 1 | 1 | 0% | 1,143 | 5,038 | +341% | 0 | 0 | — |
case-07 | pass→pass | 8,594 | 8,784 | +2% | 1 | 1 | 0% | 1,618 | 5,569 | +244% | 0 | 0 | — |
case-08 | pass→pass | 5,038 | 5,001 | -1% | 1 | 1 | 0% | 876 | 4,854 | +454% | 0 | 0 | — |
case-09 | pass→pass | 12,405 | 8,210 | -34% | 1 | 1 | 0% | 2,395 | 5,512 | +130% | 0 | 0 | — |
case-10 | pass→pass | 6,431 | 7,350 | +14% | 1 | 1 | 0% | 1,108 | 5,188 | +368% | 0 | 0 | — |
case-11 | pass→pass | 8,045 | 5,667 | -30% | 1 | 1 | 0% | 1,406 | 4,993 | +255% | 0 | 0 | — |
case-20 | pass→pass | 29,774 | 13,385 | -55% | 1 | 1 | 0% | 2,823 | 6,412 | +127% | 0 | 0 | — |
case-12 | pass→pass | 5,133 | 4,496 | -12% | 1 | 1 | 0% | 965 | 4,834 | +401% | 0 | 0 | — |
case-13 | pass→pass | 3,079 | 2,934 | -5% | 1 | 1 | 0% | 499 | 4,546 | +811% | 0 | 0 | — |
case-14 | pass→pass | 5,475 | 3,584 | -35% | 1 | 1 | 0% | 923 | 4,691 | +408% | 0 | 0 | — |
case-15 | fail→pass | 13,224 | 15,242 | +15% | 1 | 1 | 0% | 2,041 | 6,057 | +197% | 0 | 0 | — |
case-16 | fail→pass | 13,455 | 5,190 | -61% | 1 | 1 | 0% | 1,440 | 4,903 | +240% | 0 | 0 | — |
case-17 | pass→pass | 4,524 | 3,604 | -20% | 1 | 1 | 0% | 366 | 4,585 | +1153% | 0 | 0 | — |
case-18 | pass→pass | 5,618 | 4,322 | -23% | 1 | 1 | 0% | 767 | 4,775 | +523% | 0 | 0 | — |
case-19 | pass→pass | 5,892 | 6,111 | +4% | 1 | 1 | 0% | 968 | 5,027 | +419% | 0 | 0 | — |
case-21 | pass→fail | 12,440 | 5,663 | -54% | 1 | 1 | 0% | 1,318 | 4,990 | +279% | 0 | 0 | — |
case-22 | pass→pass | 4,216 | 4,447 | +5% | 1 | 1 | 0% | 705 | 4,755 | +574% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.