Skip to content

Consul HTTPS unix socket binds HTTP instead #16252

@putz612

Description

@putz612

When filing a bug, please include the following headings if possible. Any example text in this template can be deleted.

Overview of the Issue

In testing using unix sockets for connect envoy and consul I have come across that entering a unix socket for https results in a http socket instead.

Reproduction Steps

Steps to reproduce this issue, eg:

  1. Create a consul config supplying all the TLS goodies and add the https address section pointing to a unix socket. In my case I am using the consul docker container 1.14.4
    "addresses": {
        "grpc_tls" : "unix://consul/consul_grpc.sock",
        "http" : "unix://consul/consul_http.sock",
        "https" : "unix://consul/consul_https.sock"
    },
  1. Configure consul connect to connect to the socket using environment vars
      - CONSUL_HTTP_ADDR=unix://consul/consul_https.sock
      - CONSUL_HTTP_SSL=true
  1. View error
    us-consul-gateway | Error registering service "gateway-us": Put "https://consul%2Fconsul_https.sock/v1/agent/service/register": http: server gave HTTP response to HTTPS client

Consul info for both Client and Server

Client info
# consul info
agent:
	check_monitors = 0
	check_ttls = 0
	checks = 1
	services = 1
build:
	prerelease =
	revision = dae670fe
	version = 1.14.4
	version_metadata =
consul:
	acl = enabled
	known_servers = 1
	server = false
runtime:
	arch = arm64
	cpu_count = 2
	goroutines = 98
	max_procs = 2
	os = linux
	version = go1.19.4
serf_lan:
	coordinate_resets = 0
	encrypted = true
	event_queue = 0
	event_time = 2
	failed = 0
	health_score = 0
	intent_queue = 0
	left = 0
	member_time = 25
	members = 2
	query_queue = 0
	query_time = 1

Operating system and Environment details

Mac OS using docker

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions