1
0
Fork 0

Improve ACME account registration URI management

This commit is contained in:
NicoMen 2018-05-28 14:40:03 +02:00 committed by Traefiker Bot
parent 2d946d7ee7
commit 3f5772c62a
6 changed files with 44 additions and 24 deletions

View file

@ -60,6 +60,7 @@ func (s *LocalStore) get() (*StoredData, error) {
return nil, err
}
if isOldRegistration {
log.Debug("Reset ACME account.")
s.storedData.Account = nil
s.SaveDataChan <- s.storedData
}

View file

@ -114,6 +114,11 @@ func (p *Provider) init() error {
return fmt.Errorf("unable to get ACME account : %v", err)
}
// Reset Account if caServer changed, thus registration URI can be updated
if p.account != nil && p.account.Registration != nil && !strings.HasPrefix(p.account.Registration.URI, p.CAServer) {
p.account = nil
}
p.certificates, err = p.Store.GetCertificates()
if err != nil {
return fmt.Errorf("unable to get ACME certificates : %v", err)
@ -315,7 +320,6 @@ func (p *Provider) getClient() (*acme.Client, error) {
}
p.client = client
}
return p.client, nil
}