Beispiel #1
0
// CleanUp removes the challenge certificate from the cache.
func (s tlsSniSolver) CleanUp(domain, token, keyAuth string) error {
	_, acmeDomain, err := acme.TLSSNI01ChallengeCert(keyAuth)
	if err != nil {
		return err
	}
	uncacheCertificate(acmeDomain)
	return nil
}
Beispiel #2
0
// Present adds the challenge certificate to the cache.
func (s tlsSniSolver) Present(domain, token, keyAuth string) error {
	cert, acmeDomain, err := acme.TLSSNI01ChallengeCert(keyAuth)
	if err != nil {
		return err
	}
	cacheCertificate(Certificate{
		Certificate: cert,
		Names:       []string{acmeDomain},
	})
	return nil
}
Beispiel #3
0
func (c *wrapperChallengeProvider) Present(domain, token, keyAuth string) error {
	cert, _, err := acme.TLSSNI01ChallengeCert(keyAuth)
	if err != nil {
		return err
	}
	cert.Leaf, err = x509.ParseCertificate(cert.Certificate[0])
	if err != nil {
		return err
	}

	c.lock.Lock()
	defer c.lock.Unlock()
	for i := range cert.Leaf.DNSNames {
		c.challengeCerts[cert.Leaf.DNSNames[i]] = &cert
	}

	return nil

}