fix: add tls config to unix socket when https is used

pull/16301/head
cskh 2023-02-17 00:11:17 -05:00
parent 2460ac99c9
commit 49f7423ab8
1 changed files with 2 additions and 1 deletions

View File

@ -1051,7 +1051,8 @@ func (a *Agent) listenHTTP() ([]apiServer, error) {
for _, l := range listeners { for _, l := range listeners {
var tlscfg *tls.Config var tlscfg *tls.Config
_, isTCP := l.(*tcpKeepAliveListener) _, isTCP := l.(*tcpKeepAliveListener)
if isTCP && proto == "https" { isUnix := l.Addr().Network() == "unix"
if (isTCP || isUnix) && proto == "https" {
tlscfg = a.tlsConfigurator.IncomingHTTPSConfig() tlscfg = a.tlsConfigurator.IncomingHTTPSConfig()
l = tls.NewListener(l, tlscfg) l = tls.NewListener(l, tlscfg)
} }