-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connect with Envoy: gRPC over HTTPS in a new cluster only works when CONSUL_HTTP_SSL is true #7473
Comments
Hi @akhayyat Thank you for finding this! |
I had a quick look at the code, and here is what I found: consul/command/connect/envoy/envoy.go Lines 414 to 426 in 32daa2b
Lines 69 to 73 in 32daa2b
So the This might be the correct behaviour. I believe consul/command/connect/envoy/envoy.go Lines 347 to 359 in 32daa2b
Maybe in this case we need to be defaulting it to an address with a scheme, so that the subsequent checks detect https correctly. I'm not yet sure how we would find the scheme at this place, but I will have another look. |
Thanks for looking into this issue. What I considered buggy is that this behavior is inconsistent with the documentation of the
In my case, with |
You are correct, there is definitely a bug here. |
I enabled TLS in my Nomad/Consul clusters and all of them started having this issue on the Nomad Agents.
The only way I was able to resolve the issue was by physically rebooting the vm. I also had to ensure the following is defined in the nomad config
|
Overview of the Issue
When using Connect with Envoy, Envoy uses HTTPS to connect to the Consul agent for the first time only when
CONSUL_HTTP_SSL
is true, even ifCONSUL_HTTP_ADDR
is set to use HTTPS. After it has connected for the first time (withCONSUL_HTTP_SSL
enabled), it is able to connect again even without settingCONSUL_HTTP_SSL
.Reproduction Steps
Create a cluster with HTTP (8500), HTTPS (8501), and GRPC (8502) ports enabled, and with Connect enabled
Define a service with a sidecar proxy configured to use
CONSUL_HTTP_ADDR=https://127.0.0.1:8501
(without settingCONSUL_HTTP_SSL
)Envoy fails to connect to the Consul agent:
Agent log:
Envoy log:
When
CONSUL_HTTP_SSL
is set to true, the':scheme', 'http'
line becomes':scheme', 'https'
.Here is a full Ansible playbook that reproduces this problem:
https://gist.github.com/akhayyat/4a6a5718425ac4addfef3fa9bb932c65
Consul info for both Client and Server
Client info
Server info
Operating system and Environment details
Debian 10, amd64.
The text was updated successfully, but these errors were encountered: