Shopify / toxiproxy

:alarm_clock: :fire: A TCP proxy to simulate network and system conditions for chaos and resiliency testing
https://github.com/shopify/toxiproxy
MIT License
10.59k stars 444 forks source link

Client sent an HTTP request to an HTTPS server. #262

Open LordBrain opened 5 years ago

LordBrain commented 5 years ago

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 commented 4 years ago

Any thoughts on this?

xthexder commented 4 years ago

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.