Skip to content

fix: preserve externally-provided TLS certificates#232

Merged
chadbyte merged 1 commit into
chadbyte:mainfrom
egns-ai:fix/preserve-external-certs
Mar 20, 2026
Merged

fix: preserve externally-provided TLS certificates#232
chadbyte merged 1 commit into
chadbyte:mainfrom
egns-ai:fix/preserve-external-certs

Conversation

@egns-ai
Copy link
Copy Markdown
Contributor

@egns-ai egns-ai commented Mar 19, 2026

Summary

  • Fixes fix: ensureCerts overwrites externally-provided TLS certificates on startup #230ensureCerts overwrites external certificates (e.g. from tailscale cert) with self-signed mkcert certs on every daemon startup
  • Adds a check to skip IP-completeness validation and mkcert regeneration when the existing cert was not issued by mkcert
  • External certs (Tailscale, Let's Encrypt, etc.) are now left untouched

Change

Single line addition in ensureCerts():

if (certText.indexOf("mkcert") === -1) return { key: keyPath, cert: certPath, caRoot: caRoot };

This early-returns before the IP SAN check when the cert issuer is not mkcert, preventing regeneration of externally-provided certificates.

Test plan

  • Provide an external cert (e.g. via tailscale cert) and verify it is preserved across daemon restarts
  • Verify mkcert-generated certs still regenerate when IPs change
  • Verify fresh installs with no existing cert still generate via mkcert

🤖 Generated with Claude Code

ensureCerts overwrites external certificates (e.g. from tailscale cert)
with self-signed mkcert certs on every startup because external certs
don't contain all local IPs in their SANs. Skip IP-completeness checks
when the cert was not issued by mkcert.

Fixes chadbyte#230

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chadbyte
Copy link
Copy Markdown
Owner

@egns-ai LGTM! Clean fix, thanks. The external cert detection is clear and doesn't affect the existing mkcert flow. 👍

@chadbyte chadbyte merged commit c7d9e09 into chadbyte:main Mar 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This issue has been resolved in version 2.13.0-beta.3 (main).

To update, run:

npx clay-server@2.13.0-beta.3

-- Clay Deploy Bot

Build anything, with anyone, in one place.

@github-actions
Copy link
Copy Markdown
Contributor

This issue has been resolved in version 2.13.0 (stable).

To update, run:

npx clay-server@2.13.0

-- Clay Deploy Bot

Build anything, with anyone, in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: ensureCerts overwrites externally-provided TLS certificates on startup

2 participants