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{},
|
||||
StaticCerts: &safe.Safe{},
|
||||
}
|
||||
acmeprovider.SetCertificateStore(*entryPoint.CertificateStore)
|
||||
acmeprovider.SetCertificateStore(entryPoint.CertificateStore)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ type Provider struct {
|
|||
client *acme.Client
|
||||
certsChan chan *Certificate
|
||||
configurationChan chan<- types.ConfigMessage
|
||||
certificateStore traefiktls.CertificateStore
|
||||
certificateStore *traefiktls.CertificateStore
|
||||
clientMutex sync.Mutex
|
||||
configFromListenerChan chan types.Configuration
|
||||
pool *safe.Pool
|
||||
|
@ -185,7 +185,7 @@ func (p *Provider) watchNewDomains() {
|
|||
}
|
||||
|
||||
// SetCertificateStore allow to initialize certificate store
|
||||
func (p *Provider) SetCertificateStore(certificateStore traefiktls.CertificateStore) {
|
||||
func (p *Provider) SetCertificateStore(certificateStore *traefiktls.CertificateStore) {
|
||||
p.certificateStore = certificateStore
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ func TestGetUncheckedCertificates(t *testing.T) {
|
|||
t.Parallel()
|
||||
|
||||
acmeProvider := Provider{
|
||||
certificateStore: traefiktls.CertificateStore{
|
||||
certificateStore: &traefiktls.CertificateStore{
|
||||
DynamicCerts: test.dynamicCerts,
|
||||
StaticCerts: test.staticCerts,
|
||||
},
|
||||
|
|
|
@ -92,7 +92,7 @@ type serverEntryPoint struct {
|
|||
httpServer *http.Server
|
||||
listener net.Listener
|
||||
httpRouter *middlewares.HandlerSwitcher
|
||||
certs safe.Safe
|
||||
certs *safe.Safe
|
||||
onDemandListener func(string) (*tls.Certificate, error)
|
||||
}
|
||||
|
||||
|
@ -674,7 +674,7 @@ func (s *Server) createTLSConfig(entryPointName string, tlsOption *traefiktls.TL
|
|||
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 {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -836,7 +836,9 @@ func (s *Server) buildEntryPoints() map[string]*serverEntryPoint {
|
|||
onDemandListener: entryPoint.OnDemandListener,
|
||||
}
|
||||
if entryPoint.CertificateStore != nil {
|
||||
serverEntryPoints[entryPointName].certs = *entryPoint.CertificateStore.DynamicCerts
|
||||
serverEntryPoints[entryPointName].certs = entryPoint.CertificateStore.DynamicCerts
|
||||
} else {
|
||||
serverEntryPoints[entryPointName].certs = &safe.Safe{}
|
||||
}
|
||||
}
|
||||
return serverEntryPoints
|
||||
|
|
Loading…
Reference in a new issue