Skip to content

feat(tls): implement OCSP stapling / --cert-status support#134

Merged
jonwiggins merged 1 commit intomainfrom
optio/task-ecc18b14-7718-4daa-a76d-9552cf5c4b23
Mar 28, 2026
Merged

feat(tls): implement OCSP stapling / --cert-status support#134
jonwiggins merged 1 commit intomainfrom
optio/task-ecc18b14-7718-4daa-a76d-9552cf5c4b23

Conversation

@jonwiggins
Copy link
Copy Markdown
Owner

Summary

  • Implement OCSP stapling (certificate status verification) in the rustls TLS layer via a custom OcspCheckingVerifier that wraps the standard WebPKI verifier and requires non-empty OCSP stapled responses
  • Wire --cert-status CLI flag from no-op to functional, enabling OCSP verification that fails with exit code 91 (CURLE_SSL_INVALIDCERTSTATUS) when the server doesn't staple an OCSP response
  • Add CURLOPT_SSL_VERIFYSTATUS (232) to the FFI layer with proper error mapping
  • Add SslInvalidCertStatus error variant and report "OCSP-stapling" in --version Features

Closes #123

Test plan

  • cargo fmt -- --check passes
  • cargo clippy passes with no new warnings
  • cargo test passes (345 unit + 8 doc tests)
  • cargo doc --no-deps passes with no warnings
  • Manual test: urlx --cert-status https://example.com should fail with exit code 91 if server doesn't provide OCSP stapling
  • Manual test: urlx --cert-status https://mozilla.org (which staples OCSP) should succeed

🤖 Generated with Claude Code

Implement OCSP certificate status verification (OCSP stapling) across
all layers of the project:

- Add `verify_status` field to `TlsConfig` (default: false)
- Add `OcspCheckingVerifier` wrapper that requires non-empty OCSP
  stapled responses from TLS servers during handshake
- Add `ssl_verify_status()` method to `Easy` handle
- Wire `--cert-status` CLI flag (previously a no-op) to enable OCSP
  verification, failing with exit code 91 if the server doesn't
  provide a stapled OCSP response
- Add `SslInvalidCertStatus` error variant mapping to
  `CURLE_SSL_INVALIDCERTSTATUS` (91)
- Add `CURLOPT_SSL_VERIFYSTATUS` (232) to the FFI layer
- Report "OCSP-stapling" in `--version` Features output

Closes #123

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jonwiggins jonwiggins merged commit e7cbc94 into main Mar 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(tls): OCSP stapling / cert-status support

1 participant