From a21524c6b33d6a24d7a31b5c80124239a4c81553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20G=C3=BCzel?= Date: Thu, 27 Sep 2018 05:16:39 +0300 Subject: [PATCH] Add hostname to TLS config for SNI support (#4747) --- plugins/inputs/x509_cert/x509_cert.go | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/inputs/x509_cert/x509_cert.go b/plugins/inputs/x509_cert/x509_cert.go index 252b60e1f2398..affd3fa0428be 100644 --- a/plugins/inputs/x509_cert/x509_cert.go +++ b/plugins/inputs/x509_cert/x509_cert.go @@ -80,6 +80,7 @@ func (c *X509Cert) getCert(location string, timeout time.Duration) ([]*x509.Cert } defer ipConn.Close() + tlsCfg.ServerName = u.Host conn := tls.Client(ipConn, tlsCfg) defer conn.Close()