mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-30 19:55:04 -04:00
Only enforces SNI matching if ClientAuth is enabled (#3096)
This commit is contained in:
parent
4fbdd23283
commit
fa7322365a
@ -448,6 +448,7 @@ func (s *Server) serveHTTP(w http.ResponseWriter, r *http.Request) (int, error)
|
|||||||
// sites that rely on TLS ClientAuth sharing a port with
|
// sites that rely on TLS ClientAuth sharing a port with
|
||||||
// sites that do not - if mismatched, close the connection
|
// sites that do not - if mismatched, close the connection
|
||||||
if !vhost.TLS.InsecureDisableSNIMatching && r.TLS != nil &&
|
if !vhost.TLS.InsecureDisableSNIMatching && r.TLS != nil &&
|
||||||
|
vhost.TLS.ClientAuth != tls.NoClientCert &&
|
||||||
strings.ToLower(r.TLS.ServerName) != strings.ToLower(hostname) {
|
strings.ToLower(r.TLS.ServerName) != strings.ToLower(hostname) {
|
||||||
r.Close = true
|
r.Close = true
|
||||||
log.Printf("[ERROR] %s - strict host matching: SNI (%s) and HTTP Host (%s) values differ",
|
log.Printf("[ERROR] %s - strict host matching: SNI (%s) and HTTP Host (%s) values differ",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user