# API Sec Tls Certificates

> Audits API transport security: TLS certificate validation with openssl, SSL/TLS configuration scanning with testssl.sh and sslyze, and header checks. Use when working with tls certificates, config scans or when the user mentions tls certificates, config scans.

- Skill: `opknock/api-sec-tls-certificates` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/api-sec-tls-certificates`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/api-sec-tls-certificates/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/api-sec-tls-certificates

---


Audits API transport security: TLS certificate validation with openssl, SSL/TLS configuration scanning with testssl.sh and sslyze, and header checks.

## Agentic Workflow: Read -> Reason -> Act (api-sec-tls-certificates)

You are **Api Sec Tls Certificates** (security) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — security context for `api-sec-tls-certificates`
- Domain: Audits API transport security: TLS certificate validation with openssl, SSL/TLS configuration scanning with testssl.sh and sslyze, and header checks.
- **tls-certificates**: Inspect TLS certificates and handshakes — `echo | openssl s_client -connect api.example.com:443 -servername api.example.com`
- **config-scans**: Scan TLS configuration with testssl.sh — `testssl.sh api.example.com`
- Check `knowledge` and `prerequisites: node.js, python, owasp-zap`

### 2. Reason — think for `api-sec-tls-certificates`
- For `tls-certificates`: Inspect TLS certificates and handshakes — decide which checks to run
- For `config-scans`: Scan TLS configuration with testssl.sh — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `api-sec-tls-certificates` tools
- Tools: `Glob`, `Grep`, `Read`, `Echo`, `Bash` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `api-sec-tls-certificates:00bf65fd`

# API Security v4 - TLS

Transport security auditing.

## What This Skill Does
- Verifies certificate validity and chain
- Scans cipher and protocol support
- Checks security response headers

## When to Use
- Certificate renewal verification
- PCI compliance evidence
- Post-incident transport review

## Real Commands

```bash
echo | openssl s_client -connect api.example.com:443 -servername api.example.com 2>/dev/null | openssl x509 -noout -subject -dates -issuer
testssl.sh api.example.com
npx sslyze api.example.com --certinfo
```

## Checks
- Certificate expiry and SANs
- TLS 1.2/1.3 enabled, 1.0/1.1 disabled
- Weak ciphers negotiated
- HSTS header present

## Testing
- Test from external networks to see public config
- Compare staging and production configs
- Re-test after any config change

## Best Practices
- Enforce TLS 1.2+ and modern ciphers
- Send HSTS with a long max-age
- Automate expiry monitoring

## Capabilities

### tls-certificates
Inspect TLS certificates and handshakes

**Parameters:**
- `host` (string): Target hostname
- `port` (integer): TLS port, default 443
- `protocol` (string): TLS version to test

**Commands:**
- `echo | openssl s_client -connect api.example.com:443 -servername api.example.com 2>/dev/null | openssl x509 -noout -subject -dates -issuer`
- `echo | openssl s_client -connect api.example.com:443 -tls1_2 -servername api.example.com 2>/dev/null | grep -E 'Protocol|Cipher'`
- `curl -sI http://localhost:8080 | grep -iE 'strict-transport|content-security'`
- `npx sslyze api.example.com --certinfo`

**Examples:**
- openssl s_client extracts certificate details
- -tls1_2 forces the protocol for version checks
- sslyze --certinfo reports cert chain issues

### config-scans
Scan TLS configuration with testssl.sh

**Commands:**
- `testssl.sh api.example.com`
- `testssl.sh --hints api.example.com`
- `testssl.sh --ssl-native api.example.com`
- `curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8080/health`

**Examples:**
- -cli --help
- -api --help

## References
- [OpenSSL s_client](https://docs.openssl.org/master/man1/openssl-s_client/)
- [testssl.sh](https://testssl.sh/)

