Skip to content

feat(https): answer only for Lens's domains and require client certificates - #371

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-lph29l
Oct 15, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-lph29l

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: Lens's built-in HTTPS answered any TLS handshake that reached it, for any name or none, and anyone could connect.

After: Settings › HTTPS › Who gets in (all off by default):

  • Answer only for these domains (strict_sni): a handshake happens only for the listed domains; the bare IP, another name or no SNI is refused, and a Host that doesn't match the connection's name gets 421.
  • Client certificates (client_auth off / optional / required, client_ca PEM): required is mutual TLS, only devices with a certificate signed by your CA get a connection at all.
  • Oldest TLS version (min_tls): 1.2 or 1.3.

How: Caddy tls_connection_policies matched on SNI, with client_authentication from an inline CA (trusted_ca_certs), protocol_min, strict_sni_host, and a catch-all 421 route. The CA is validated on save. Checked live against Caddy 2.10.2: no client cert → "certificate required"; other SNI or none → handshake refused; Host mismatch → 421. Docs, CHANGELOG, backend and jest tests added; make openapi clean.

Motivation and Context

Adeel asked for built-in security matching SNI, and client-side certificates.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project.
  • I added or updated tests.
  • I have updated docs/ accordingly (docs/https.md).
  • CHANGELOG.md under Unreleased.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YB1b1hox6iFRdfWcpoKZwK


Generated by Claude Code

…icates

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YB1b1hox6iFRdfWcpoKZwK
@adeelahmad
adeelahmad merged commit 624435d into main Oct 15, 2026
10 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-lph29l branch October 15, 2026 00:28
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.

2 participants