@@ -66,7 +66,7 @@ type HostPolicy func(ctx context.Context, host string) error
66
66
//
67
67
// Note that all hosts will be converted to Punycode via idna.Lookup.ToASCII so that
68
68
// 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.
70
70
func HostWhitelist (hosts ... string ) HostPolicy {
71
71
whitelist := make (map [string ]bool , len (hosts ))
72
72
for _ , h := range hosts {
@@ -252,15 +252,14 @@ func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate,
252
252
}
253
253
254
254
// 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.
260
259
//
261
260
// Due to the "σςΣ" problem (see https://unicode.org/faq/idn.html#22), we can't use
262
261
// idna.Punycode.ToASCII (or just idna.ToASCII) here.
263
- name , err := idna .Lookup .ToASCII (hello . ServerName )
262
+ name , err := idna .Lookup .ToASCII (name )
264
263
if err != nil {
265
264
return nil , errors .New ("acme/autocert: server name contains invalid character" )
266
265
}
0 commit comments