hashicorp / hashicorp/consul

in Connect, I cannot expose path for HTTPS endpoints inside the container

Open
#20,930 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
1d 18h
Merged PRs (30d)
39

Description

#### Feature Description

Allow using [Expose Paths](https://developer.hashicorp.com/consul/docs/connect/proxies/proxy-config-reference#expose-paths-configuration-reference) with HTTPS, in addition to the existing `http` and `http2` modes.

#### My alternatives
- I downgrade the server I want to expose from HTTP to HTTPS (not an option for me)
- I expose the HTTPS server outside of the Connect network (but intentions won't apply!)

#### Use Case(s)

I am using cockroachdb, set up with my own self-signed certificates manually (because otherwise it enters this restrictive 'insecure' mode).

It exposes health checks and metrics endpoints I would like to scrape with prometheus, but these are served via HTTPS only.

I tried using the [expose config with Nomad](https://developer.hashicorp.com/nomad/docs/job-specification/expose), but it seems that TLS is terminated somewhere by the sidecar:

```
# the sidecar proxy exposes the path at 10.10.0.1:20373

❯ curl 10.10.0.1:20373/_status/vars
# this is returned by the cockroachdb HTTP server and forwarded appropriately:
Temporary Redirect.

❯ curl https://10.10.0.1:20373/_status/vars
# sidecar returned HTTP response?
curl: (35) LibreSSL/3.3.6: error:1404B42E:SSL routines:ST_CONNECT:tlsv1 alert protocol version
```

I do not mind that the sidecar terminates HTTPS and exposes the path at HTTP (although ideally it would not terminate TLS at all) but in this case I would expect to be able to reach my container's HTTPS endpoint for scraping

Contributor guide

Open the contributing guide

Research direction

Start with the linked Consul Connect Expose Paths configuration reference and the Nomad expose configuration example, then trace how the sidecar handles the existing http and http2 modes. Done means an HTTPS endpoint inside the container can be exposed and reached for scraping without the current protocol error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
infrastructure, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.