Does not generate ACME certificate if domain is checked by dynamic certificate
This commit is contained in:
parent
3b3ca89483
commit
a1bbaec71f
4 changed files with 9 additions and 7 deletions
|
@ -202,7 +202,7 @@ func runCmd(globalConfiguration *configuration.GlobalConfiguration, configFile s
|
||||||
DynamicCerts: &safe.Safe{},
|
DynamicCerts: &safe.Safe{},
|
||||||
StaticCerts: &safe.Safe{},
|
StaticCerts: &safe.Safe{},
|
||||||
}
|
}
|
||||||
acmeprovider.SetCertificateStore(*entryPoint.CertificateStore)
|
acmeprovider.SetCertificateStore(entryPoint.CertificateStore)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ type Provider struct {
|
||||||
client *acme.Client
|
client *acme.Client
|
||||||
certsChan chan *Certificate
|
certsChan chan *Certificate
|
||||||
configurationChan chan<- types.ConfigMessage
|
configurationChan chan<- types.ConfigMessage
|
||||||
certificateStore traefiktls.CertificateStore
|
certificateStore *traefiktls.CertificateStore
|
||||||
clientMutex sync.Mutex
|
clientMutex sync.Mutex
|
||||||
configFromListenerChan chan types.Configuration
|
configFromListenerChan chan types.Configuration
|
||||||
pool *safe.Pool
|
pool *safe.Pool
|
||||||
|
@ -185,7 +185,7 @@ func (p *Provider) watchNewDomains() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetCertificateStore allow to initialize certificate store
|
// SetCertificateStore allow to initialize certificate store
|
||||||
func (p *Provider) SetCertificateStore(certificateStore traefiktls.CertificateStore) {
|
func (p *Provider) SetCertificateStore(certificateStore *traefiktls.CertificateStore) {
|
||||||
p.certificateStore = certificateStore
|
p.certificateStore = certificateStore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ func TestGetUncheckedCertificates(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
acmeProvider := Provider{
|
acmeProvider := Provider{
|
||||||
certificateStore: traefiktls.CertificateStore{
|
certificateStore: &traefiktls.CertificateStore{
|
||||||
DynamicCerts: test.dynamicCerts,
|
DynamicCerts: test.dynamicCerts,
|
||||||
StaticCerts: test.staticCerts,
|
StaticCerts: test.staticCerts,
|
||||||
},
|
},
|
||||||
|
|
|
@ -92,7 +92,7 @@ type serverEntryPoint struct {
|
||||||
httpServer *http.Server
|
httpServer *http.Server
|
||||||
listener net.Listener
|
listener net.Listener
|
||||||
httpRouter *middlewares.HandlerSwitcher
|
httpRouter *middlewares.HandlerSwitcher
|
||||||
certs safe.Safe
|
certs *safe.Safe
|
||||||
onDemandListener func(string) (*tls.Certificate, error)
|
onDemandListener func(string) (*tls.Certificate, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -674,7 +674,7 @@ func (s *Server) createTLSConfig(entryPointName string, tlsOption *traefiktls.TL
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
err := s.globalConfiguration.ACME.CreateClusterConfig(s.leadership, config, &s.serverEntryPoints[entryPointName].certs, checkOnDemandDomain)
|
err := s.globalConfiguration.ACME.CreateClusterConfig(s.leadership, config, s.serverEntryPoints[entryPointName].certs, checkOnDemandDomain)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -836,7 +836,9 @@ func (s *Server) buildEntryPoints() map[string]*serverEntryPoint {
|
||||||
onDemandListener: entryPoint.OnDemandListener,
|
onDemandListener: entryPoint.OnDemandListener,
|
||||||
}
|
}
|
||||||
if entryPoint.CertificateStore != nil {
|
if entryPoint.CertificateStore != nil {
|
||||||
serverEntryPoints[entryPointName].certs = *entryPoint.CertificateStore.DynamicCerts
|
serverEntryPoints[entryPointName].certs = entryPoint.CertificateStore.DynamicCerts
|
||||||
|
} else {
|
||||||
|
serverEntryPoints[entryPointName].certs = &safe.Safe{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return serverEntryPoints
|
return serverEntryPoints
|
||||||
|
|
Loading…
Reference in a new issue