Add ACME profile support for IP address certificates

Auto-select `shortlived` profile for Let's Encrypt when domain list
contains IP addresses. Expose `profile` option to allow manual override
for custom CA servers.
This commit is contained in:
世界
2026-03-26 15:19:26 +08:00
parent e1d459c5d5
commit 86c44a3e12
6 changed files with 48 additions and 0 deletions
+11
View File
@@ -69,10 +69,21 @@ func startACME(ctx context.Context, logger logger.Logger, options option.Inbound
Storage: storage,
Logger: zapLogger,
}
profile := options.Profile
if profile == "" && acmeServer == certmagic.LetsEncryptProductionCA {
for _, domain := range options.Domain {
if certmagic.SubjectIsIP(domain) {
profile = "shortlived"
break
}
}
}
acmeConfig := certmagic.ACMEIssuer{
CA: acmeServer,
Email: options.Email,
Agreed: true,
Profile: profile,
DisableHTTPChallenge: options.DisableHTTPChallenge,
DisableTLSALPNChallenge: options.DisableTLSALPNChallenge,
AltHTTPPort: int(options.AlternativeHTTPPort),