mirror of
https://github.com/caddyserver/caddy.git
synced 2025-02-18 14:52:49 +08:00
Use challenge domain for tls-sni solver
Matches the new upstream function signature and fixes previously broken behavior; new solver code confirmed to work during restarts
This commit is contained in:
parent
daa4de572e
commit
2b06edccd3
|
@ -113,20 +113,24 @@ type tlsSniSolver struct{}
|
||||||
|
|
||||||
// Present adds the challenge certificate to the cache.
|
// Present adds the challenge certificate to the cache.
|
||||||
func (s tlsSniSolver) Present(domain, token, keyAuth string) error {
|
func (s tlsSniSolver) Present(domain, token, keyAuth string) error {
|
||||||
cert, err := acme.TLSSNI01ChallengeCert(keyAuth)
|
cert, acmeDomain, err := acme.TLSSNI01ChallengeCert(keyAuth)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
cacheCertificate(Certificate{
|
cacheCertificate(Certificate{
|
||||||
Certificate: cert,
|
Certificate: cert,
|
||||||
Names: []string{domain},
|
Names: []string{acmeDomain},
|
||||||
})
|
})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CleanUp removes the challenge certificate from the cache.
|
// CleanUp removes the challenge certificate from the cache.
|
||||||
func (s tlsSniSolver) CleanUp(domain, token, keyAuth string) error {
|
func (s tlsSniSolver) CleanUp(domain, token, keyAuth string) error {
|
||||||
uncacheCertificate(domain)
|
_, acmeDomain, err := acme.TLSSNI01ChallengeCert(keyAuth)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
uncacheCertificate(acmeDomain)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user