From 8d0979bfd0e909288add7db466d0f5c0dd25cea9 Mon Sep 17 00:00:00 2001 From: Romain Date: Fri, 29 Sep 2023 15:26:05 +0200 Subject: [PATCH] Enable TLS for Consul Connect TCP services Co-authored-by: Kevin Pollet --- pkg/provider/consulcatalog/config.go | 1 + pkg/provider/consulcatalog/config_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/provider/consulcatalog/config.go b/pkg/provider/consulcatalog/config.go index 14c4fcc87..a45696fd4 100644 --- a/pkg/provider/consulcatalog/config.go +++ b/pkg/provider/consulcatalog/config.go @@ -229,6 +229,7 @@ func (p *Provider) addServerTCP(item itemData, loadBalancer *dynamic.TCPServersL if item.ExtraConf.ConsulCatalog.Connect { loadBalancer.ServersTransport = itemServersTransportKey(item) + loadBalancer.Servers[0].TLS = true } loadBalancer.Servers[0].Address = net.JoinHostPort(item.Address, port) diff --git a/pkg/provider/consulcatalog/config_test.go b/pkg/provider/consulcatalog/config_test.go index d1a606554..972ac3586 100644 --- a/pkg/provider/consulcatalog/config_test.go +++ b/pkg/provider/consulcatalog/config_test.go @@ -2245,6 +2245,7 @@ func Test_buildConfiguration(t *testing.T) { Servers: []dynamic.TCPServer{ { Address: "127.0.0.1:80", + TLS: true, }, }, ServersTransport: "tls-ns-dc1-Test",