Skip to content

egress: present a stable QUIC certificate when configured - #455

Draft
AGMETEOR wants to merge 1 commit into
mainfrom
allan/egress-stable-tls
Draft

AGMETEOR wants to merge 1 commit into
mainfrom
allan/egress-stable-tls

Conversation

@AGMETEOR

@AGMETEOR AGMETEOR commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

context

summary

  • TLSConfigFromEnv (tls.go):
    • with TLS_CERT_FILE and TLS_KEY_FILE set (the names examples/private-swarm/egress-server already uses), the egress presents that certificate
    • with neither set, it keeps the per-process self-signed certificate and the DANGER banner, so current deployments are unchanged
    • with only one set, it fails at startup
  • the sing-box, http and socks5 builds use it, replacing three copies of the banner and fallback
  • the egress dials the consumer, so this is a TLS client certificate: it needs the clientAuth extended key usage and a SAN equal to the track's egress_server_name
  • the egress still doesn't verify the consumer, which is anonymous by design

tests

tls_test.go, using a consumer configured like lantern-box's verifying path (RequireAndVerifyClientCert, ClientCAs, SAN check), with the egress as TLS client as in production:

  • a CA-issued egress cert loaded from env passes verification
  • the self-signed fallback is rejected ("certificate signed by unknown authority")
  • one env var without the other, and missing files, fail
  • go test -race ./egress/... ./common/... passes

rollout (not in this PR)

  1. issue a CA and an egress cert (clientAuth, SAN = chosen egress_server_name); put the cert and key on egress hosts, e.g. from Vault in lantern-cloud's egress deploy, and set the two env vars
  2. only once every egress presents it, set egress_ca and egress_server_name on the unbounded track. Current clients already honour those options, so setting them before the egress presents the cert breaks every unbounded connection
  3. lantern-box then sends the device ID in the hello only when verification is on (unbounded: send a consumer hello to the egress lantern-box#355 follow-up)

🤖 Generated with Claude Code

Every egress build generated a fresh self-signed certificate per
process, so a consumer could never verify the egress against its
egress_ca / egress_server_name options. Without that, a donor can
impersonate the egress and read anything sent inside QUIC.

With TLS_CERT_FILE and TLS_KEY_FILE set (the names the private-swarm
example already uses), the egress presents that certificate. Without
them it keeps the per-process self-signed certificate and its warning.
The three egress builds share this instead of each duplicating it.

Part of getlantern/engineering#3702.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

1 participant