From 98bba33861b945a310e3d1ab3ebd56ad5d8e81c7 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Thu, 8 Sep 2016 18:49:21 -0600 Subject: [PATCH] Lower-case server name for good measure This already happens in the getCertificate function, but doing it here guarantees case insensitivity across the board for this handshake. --- caddytls/handshake.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caddytls/handshake.go b/caddytls/handshake.go index 09e26fe9..ae9f0cee 100644 --- a/caddytls/handshake.go +++ b/caddytls/handshake.go @@ -59,7 +59,7 @@ func (cg configGroup) getConfig(name string) *Config { // // This method is safe for use as a tls.Config.GetCertificate callback. func (cg configGroup) GetCertificate(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error) { - cert, err := cg.getCertDuringHandshake(clientHello.ServerName, true, true) + cert, err := cg.getCertDuringHandshake(strings.ToLower(clientHello.ServerName), true, true) return &cert.Certificate, err }