Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #6 from philips/alpn-challenge
Browse files Browse the repository at this point in the history
autocert: fix issue with challenge
  • Loading branch information
philips authored Aug 2, 2019
2 parents 72897e9 + 56ecbaf commit 6b0e3a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions autocert/autocert.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@ func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate,
return nil, err
}

name = policy.CommonName

// Check whether this is a token cert requested for TLS-SNI or TLS-ALPN challenge.
if wantsTokenCert(hello) {
m.tokensMu.RLock()
Expand All @@ -299,6 +297,9 @@ func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate,
return nil, fmt.Errorf("acme/autocert: no token cert for %q", name)
}

// set the name after the ALPN challenge
name = policy.CommonName

// regular domain
ck := certKey{
domain: strings.TrimSuffix(name, "."), // golang.org/issue/18114
Expand Down

0 comments on commit 6b0e3a7

Please sign in to comment.