Implement specifying cert directory

Also fixed a bug where client TLS termination was failing to get
new certs I believe because the TLS listener hadn't started up
yet. I didn't notice it before because I'm running the client and
server on the same machine and the server currently gets certs on
startup even for non-server TLS tunnels
This commit is contained in:
Anders Pitman
2020-11-27 21:20:38 -07:00
parent c08671bd13
commit 140c102c32
3 changed files with 19 additions and 7 deletions

View File

@@ -30,6 +30,8 @@ func proxyRequest(w http.ResponseWriter, r *http.Request, tunnel Tunnel, httpCli
downstreamReqHeaders := r.Header.Clone()
// TODO: should probably pass in address instead of using localhost,
// mostly for client-terminated TLS
upstreamAddr := fmt.Sprintf("localhost:%d", port)
upstreamUrl := fmt.Sprintf("http://%s%s", upstreamAddr, r.URL.RequestURI())