Skip to content

Commit 6c12694

Browse files
committed
acme/autocert: correct typo in comments
1 parent 4e9f76b commit 6c12694

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Diff for: acme/autocert/autocert.go

+6-7
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ type HostPolicy func(ctx context.Context, host string) error
6666
//
6767
// Note that all hosts will be converted to Punycode via idna.Lookup.ToASCII so that
6868
// Manager.GetCertificate can handle the Unicode IDN and mixedcase hosts correctly.
69-
// Invlaid hosts will be silently ignored.
69+
// Invalid hosts will be silently ignored.
7070
func HostWhitelist(hosts ...string) HostPolicy {
7171
whitelist := make(map[string]bool, len(hosts))
7272
for _, h := range hosts {
@@ -252,15 +252,14 @@ func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate,
252252
}
253253

254254
// Note that this conversion is necessary because some server names in the handshakes
255-
// made by some clients (like cURL) is not implicitly converted to Punycode, which will
256-
// cause the certificate to fail to be obtained. In addition, we should also treat
257-
// example.com and EXAMPLE.COM as equivalent and must return the same certificate for
258-
// them. Fortunately, this conversion also helped us deal with this kind of mixedcase
259-
// problems.
255+
// started by some clients (such as cURL) are not converted to Punycode, which will
256+
// prevent us from obtaining certificates for them. In addition, we should also treat
257+
// example.com and EXAMPLE.COM as equivalent and return the same certificate for them.
258+
// Fortunately, this conversion also helped us deal with this kind of mixedcase problems.
260259
//
261260
// Due to the "σςΣ" problem (see https://unicode.org/faq/idn.html#22), we can't use
262261
// idna.Punycode.ToASCII (or just idna.ToASCII) here.
263-
name, err := idna.Lookup.ToASCII(hello.ServerName)
262+
name, err := idna.Lookup.ToASCII(name)
264263
if err != nil {
265264
return nil, errors.New("acme/autocert: server name contains invalid character")
266265
}

0 commit comments

Comments
 (0)