From 147e79ea073c98fcf58d11ccbe723aae0c948e3b Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Mon, 1 Oct 2018 16:56:03 +0200 Subject: [PATCH] TLS, ACME, cluster and several entrypoints. --- server/server.go | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/server/server.go b/server/server.go index cacad7fca..74c3beeb4 100644 --- a/server/server.go +++ b/server/server.go @@ -462,21 +462,19 @@ func (s *Server) createTLSConfig(entryPointName string, tlsOption *traefiktls.TL } } - if s.globalConfiguration.ACME != nil { - if entryPointName == s.globalConfiguration.ACME.EntryPoint { - checkOnDemandDomain := func(domain string) bool { - routeMatch := &mux.RouteMatch{} - match := router.GetHandler().Match(&http.Request{URL: &url.URL{}, Host: domain}, routeMatch) - if match && routeMatch.Route != nil { - return true - } - return false + if s.globalConfiguration.ACME != nil && entryPointName == s.globalConfiguration.ACME.EntryPoint { + checkOnDemandDomain := func(domain string) bool { + routeMatch := &mux.RouteMatch{} + match := router.GetHandler().Match(&http.Request{URL: &url.URL{}, Host: domain}, routeMatch) + if match && routeMatch.Route != nil { + return true } + return false + } - err := s.globalConfiguration.ACME.CreateClusterConfig(s.leadership, config, s.serverEntryPoints[entryPointName].certs.DynamicCerts, checkOnDemandDomain) - if err != nil { - return nil, err - } + err := s.globalConfiguration.ACME.CreateClusterConfig(s.leadership, config, s.serverEntryPoints[entryPointName].certs.DynamicCerts, checkOnDemandDomain) + if err != nil { + return nil, err } } else { config.GetCertificate = s.serverEntryPoints[entryPointName].getCertificate