mirror of https://github.com/hashicorp/consul
fix: add tls config to unix socket when https is used
parent
2460ac99c9
commit
49f7423ab8
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue