toxiproxy icon indicating copy to clipboard operation
toxiproxy copied to clipboard

Client sent an HTTP request to an HTTPS server.

Open LordBrain opened this issue 4 years ago • 2 comments

I have kind of a unique situation that can use your help on.

In my environment we terminate TLS at a LB before it gets routed to my toxiproxy instance. Then toxiproxy tries to send to the downstream service over https, but I get the Client sent an HTTP request to an HTTPS server. error.

Basic layout:

Source -> HTTPS LB (TLS Terminated here) -> toxiproxy listening on 8080 -> Downstream HTTPS LB (TLS Terminated here) -> downstream listening on 5050

I can get past it by not pointing it to the downstream HTTPS LB, but I could only hit a single service then, and it would need to be reconfigured anytime a new deployment happens. Not very user friendly.

It seems that toxiproxy only send over TCP, and doesn't try to do https even if its over port 443.

Is there any way I could get around this? Any ideas will be helpful.

LordBrain avatar Sep 06 '19 12:09 LordBrain

Any thoughts on this?

LordBrain avatar Oct 31 '19 12:10 LordBrain

Toxiproxy is a TCP level proxy, so it does not modify the contents of the data going through it at all.

Based on your layout, you're terminating TLS before Toxiproxy, so from that point on, the stream will be plain http, regardless of where you forward it. In order for your setup to work, you'll need to only terminate TLS once, or re-encrypt the connection with another http proxy before hitting the https LB.

xthexder avatar Oct 31 '19 20:10 xthexder