Skip to content

fix: dstack-ingress 2.1 — wildcard cert + evidence latency#91

Merged
h4x3rotab merged 1 commit intomainfrom
fix/dstack-ingress-2.1
Apr 14, 2026
Merged

fix: dstack-ingress 2.1 — wildcard cert + evidence latency#91
h4x3rotab merged 1 commit intomainfrom
fix/dstack-ingress-2.1

Conversation

@h4x3rotab
Copy link
Copy Markdown
Contributor

Summary

Two bug fixes for dstack-ingress, bumping to version 2.1:

  • Wildcard certificate lookup: build-combined-pems.sh looked for /etc/letsencrypt/live/*.example.com/ but certbot stores wildcard certs under /etc/letsencrypt/live/example.com/. Fixed by using the existing cert_dir_name() helper from functions.sh to strip the *. prefix.

  • 5-second latency on all traffic: The HAProxy evidence-server routing used tcp-request content accept if WAIT_END, which forces HAProxy to wait the full inspect-delay 5s before accepting every new TLS connection. Replaced with tcp-request content accept if { req.len gt 0 } — accepts as soon as any application data arrives. After SSL termination, a complete TLS record is decrypted atomically so the full HTTP request is always available on first evaluation.

Test plan

Both fixes verified on a live Phala Cloud CVM:

  • Wildcard cert (*.dstack-k3s.t16z.com) correctly obtained and served by HAProxy
  • Normal HTTPS traffic: ~0.25s (was 5.2s with WAIT_END)
  • Evidence endpoint (/evidences/, /evidences/quote.json): ~0.25s, HTTP 200
  • Three consecutive fresh-connection requests all fast (no first-request penalty)

Release

After merge, tag dstack-ingress-v2.1 to trigger CI image build → dstacktee/dstack-ingress:2.1.

🤖 Generated with Claude Code

Two bugs fixed:

1. build-combined-pems.sh: wildcard domains (e.g. *.example.com) failed
   to find their Let's Encrypt certificates because the script looked for
   /etc/letsencrypt/live/*.example.com/ while certbot stores them under
   /etc/letsencrypt/live/example.com/. Fixed by using cert_dir_name() from
   functions.sh to strip the wildcard prefix.

2. entrypoint.sh: the HAProxy evidence-server routing used
   "tcp-request content accept if WAIT_END" which forces a full 5-second
   delay (the inspect-delay value) on EVERY new TLS connection before
   routing proceeds. Replaced with "tcp-request content accept if
   { req.len gt 0 }" so HAProxy accepts as soon as any application data
   arrives in the buffer. After SSL termination a complete TLS record is
   decrypted atomically, so the full HTTP request is available on first
   evaluation.

Bump version to 2.1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@h4x3rotab h4x3rotab merged commit 18eacc9 into main Apr 14, 2026
6 checks passed
@h4x3rotab h4x3rotab deleted the fix/dstack-ingress-2.1 branch April 14, 2026 11:16
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