mirror of
https://github.com/traefik/traefik.git
synced 2025-08-12 01:27:09 +02:00
Don't fetch ACME certificates for frontends using non-TLS entrypoints
This commit is contained in:
parent
d74ea22d7d
commit
2bfc237e53
13
server.go
13
server.go
@ -301,6 +301,17 @@ func (server *Server) postLoadConfig() {
|
|||||||
currentConfigurations := server.currentConfigurations.Get().(configs)
|
currentConfigurations := server.currentConfigurations.Get().(configs)
|
||||||
for _, configuration := range currentConfigurations {
|
for _, configuration := range currentConfigurations {
|
||||||
for _, frontend := range configuration.Frontends {
|
for _, frontend := range configuration.Frontends {
|
||||||
|
|
||||||
|
// check if one of the frontend entrypoints is configured with TLS
|
||||||
|
TLSEnabled := false
|
||||||
|
for _, entrypoint := range frontend.EntryPoints {
|
||||||
|
if server.globalConfiguration.EntryPoints[entrypoint].TLS != nil {
|
||||||
|
TLSEnabled = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if TLSEnabled {
|
||||||
for _, route := range frontend.Routes {
|
for _, route := range frontend.Routes {
|
||||||
rules := Rules{}
|
rules := Rules{}
|
||||||
domains, err := rules.ParseDomains(route.Rule)
|
domains, err := rules.ParseDomains(route.Rule)
|
||||||
@ -310,7 +321,7 @@ func (server *Server) postLoadConfig() {
|
|||||||
server.globalConfiguration.ACME.LoadCertificateForDomains(domains)
|
server.globalConfiguration.ACME.LoadCertificateForDomains(domains)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user