Enable TLS for Consul Connect TCP services

Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com>
This commit is contained in:
Romain 2023-09-29 15:26:05 +02:00 committed by GitHub
parent 4acec60e72
commit 8d0979bfd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -229,6 +229,7 @@ func (p *Provider) addServerTCP(item itemData, loadBalancer *dynamic.TCPServersL
if item.ExtraConf.ConsulCatalog.Connect { if item.ExtraConf.ConsulCatalog.Connect {
loadBalancer.ServersTransport = itemServersTransportKey(item) loadBalancer.ServersTransport = itemServersTransportKey(item)
loadBalancer.Servers[0].TLS = true
} }
loadBalancer.Servers[0].Address = net.JoinHostPort(item.Address, port) loadBalancer.Servers[0].Address = net.JoinHostPort(item.Address, port)

View file

@ -2245,6 +2245,7 @@ func Test_buildConfiguration(t *testing.T) {
Servers: []dynamic.TCPServer{ Servers: []dynamic.TCPServer{
{ {
Address: "127.0.0.1:80", Address: "127.0.0.1:80",
TLS: true,
}, },
}, },
ServersTransport: "tls-ns-dc1-Test", ServersTransport: "tls-ns-dc1-Test",