Skip to content

caddytls: ECH key rotation - #7356

Merged
mholt merged 4 commits into
masterfrom
ech-key-rotation
Dec 10, 2025
Merged

mholt merged 4 commits into
masterfrom
ech-key-rotation

Conversation

@mholt

@mholt mholt commented Nov 20, 2025

Copy link
Copy Markdown
Member

This change implements ECH key rotation, made possible in Go 1.25 thanks to the GetEncryptedClientHelloKeys callback in tls.Config.

Currently, keys are rotated every 30 days, and are supported for 90 days (so, 60 days after rotation), to give clients time to update without needing to retry.

It's not clear what are actually good intervals for these things, as this is new technology and there isn't much diversity of deployments. But generally, smaller anonymity sets (fewer sites) should rotate a less frequently than big anonymity sets, and I suspect most Caddy instances are smaller.

We can always change the rotation intervals based on feedback/experience.

@mholt mholt added this to the v2.11.0 milestone Nov 20, 2025
@mholt

mholt commented Nov 24, 2025

Copy link
Copy Markdown
Member Author

Let's try something stupid:

@copilot Are there any (other) resource leaks or any security vulnerabilities in this code?

Copilot AI commented Nov 24, 2025

Copy link
Copy Markdown
Contributor

@mholt I've opened a new pull request, #7363, to work on those changes. Once the pull request is ready, I'll request review from you.

@mholt
mholt requested a review from francislavoie December 10, 2025 17:27
@mholt

mholt commented Dec 10, 2025

Copy link
Copy Markdown
Member Author

I think I've got all the missing pieces, no thanks to Copilot. πŸ₯²

Ready to merge, probably.

@francislavoie francislavoie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly don't understand ECH flows well enough to give a confident review. But I assume you've tested it, so we might as well merge.

@mholt

mholt commented Dec 10, 2025

Copy link
Copy Markdown
Member Author

Thanks; makes sense. Yeah, I tested it by reducing the rotation interval, etc, to a matter of seconds, instead of hours, and it seemed to be working!

@mholt
mholt merged commit 3c9c67e into master Dec 10, 2025
30 checks passed
@mholt
mholt deleted the ech-key-rotation branch December 10, 2025 18:50
@github-actions github-actions Bot mentioned this pull request Jan 6, 2026
4 tasks
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.

3 participants