Skip to content

Update SSL autocert to dynamically check discovered servers#234

Merged
umputun merged 1 commit intomasterfrom
fix/dynamic-ssl-fqdns-207
Nov 27, 2025
Merged

Update SSL autocert to dynamically check discovered servers#234
umputun merged 1 commit intomasterfrom
fix/dynamic-ssl-fqdns-207

Conversation

@umputun
Copy link
Owner

@umputun umputun commented Nov 27, 2025

Summary

  • Fix SSL autocert manager to dynamically check discovered servers for domain validation
  • When new services are discovered (docker containers, file config changes, consul updates), they can now get SSL certificates without requiring reproxy restart
  • Also fixes a race condition in discovery logging

Changes

app/proxy/ssl.go:

  • Added CheckDomain method to AutocertManager interface for testing
  • Modified DecisionFunc to check both static FQDNs (for explicit config) AND dynamic h.Servers() (for discovery providers)

app/proxy/ssl_test.go:

  • Added TestSSL_DynamicFQDNs verifying domains added dynamically via Servers() are accepted

app/discovery/discovery.go:

  • Changed %s to %T in provider logging to prevent race condition when context is cancelled during formatting

Related to #207

The DecisionFunc in makeAutocertManager now checks both static FQDNs
and dynamic servers from discovery providers. This allows new services
(docker containers, file config changes, consul updates) to get SSL
certificates without requiring reproxy restart.

Also fixes a race condition in discovery logging by using %T instead
of %s when formatting providers to prevent reflection on context fields.

Related to #207
@umputun umputun merged commit 3965075 into master Nov 27, 2025
2 of 5 checks passed
@umputun umputun deleted the fix/dynamic-ssl-fqdns-207 branch November 27, 2025 05:53
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