esnet / esnet/acme-proxy

Persist the ACME account key: dns01_txt mode creates a new Let's Encrypt account per certificate

Open
#60 0 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
58
Forks
7
Avg merge
1m
Merged PRs (30d)
1

Description

`createLegoClient` ([externalcas/external.go:96](https://github.com/esnet/acme-proxy/blob/6ff550aab9bcfd0c78474bf531e114305186e337/externalcas/external.go#L96)) generates a fresh account key on every call, and nothing persists it. In `dns01_txt` mode, [external.go:148](https://github.com/esnet/acme-proxy/blob/6ff550aab9bcfd0c78474bf531e114305186e337/externalcas/external.go#L148) then does a plain `Registration.Register`, so every certificate issued through Let's Encrypt creates a new ACME account.

This has two consequences:

1. **Rate limits.** Let's Encrypt allows only [10 new accounts per IP per 3 hours](https://letsencrypt.org/docs/rate-limits/).
2. **Revocation should fail.** `RevokeCertificate` also builds a fresh client, so it signs with an account that never issued the certificate. [RFC 8555 section 7.6](https://www.rfc-editor.org/rfc/rfc8555#section-7.6) does not allow that.

This issue could be solved by adding an optional `account_key_path` under `authority.config` that gets loaded/generated on startup.
This way, registration would be idempotent, because `newAccount` with a known key returns the existing account ([RFC 8555 section 7.3](https://www.rfc-editor.org/rfc/rfc8555#section-7.3)).

Contributor guide

Open the contributing guide

Research direction

Start in externalcas/external.go at createLegoClient (line 96), the dns01_txt registration path (line 148), and RevokeCertificate. Trace how authority.config is loaded and how clients are created at startup; done means an optional account_key_path loads or generates one, registration reuses the account, and revocation uses the issuing account.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.