Reverse proxy mode doesn't work with HTTPS #152

Closed
rgerganov opened this Issue Jul 21, 2013 · 3 comments

Projects

None yet

3 participants

@rgerganov

I have an HTTPS service running on 192.168.2.4:8443 and I want to setup mitmproxy to forward requests to it in reverse proxy mode. I am running:

$ mitmproxy -e -P https://192.168.2.4:8443

When I try to access https://localhost:8080 I am getting the following error in the event log:

127.0.0.1:59189: connect
127.0.0.1:59189: 400: Bad HTTP request line:
'\x16\x03\x01\x00\xf3\x01\x00\x00\xef\x03\x02Q\xeb\xfa8!\xa3qo\xd7\xf1\xd6\xc7\xea\x0c\xf7\xf9\xeaB\xf56f\x0e\x02&\xa3\x17s.\x90\x81\xca\x8c\x00\x00j\xc0\x14\xc0\n'
127.0.0.1:59189: disconnect

Does mitmproxy support HTTPS in reverse proxy mode? Thanks.

@mhils
Member
mhils commented Jul 21, 2013

Hey,

mitmproxy should be able to connect to an HTTPS server in the backend. However, it just serves as a basic HTTP server itself (1).

Cheers,
Max

@rgerganov

Hi Max,

Unfortunately this is not what I need. Here is the whole usecase:

  1. I have an HTTPS web service running at 192.168.2.4:8443
  2. I also have application that talks to the service which doesn't support HTTP(s) proxies
  3. I want to see the requests/responses exchanged by the application and the service.

This should be possible with reverse proxy mode, right? The problem is that mitmproxy starts an HTTP server in that mode but my application expects HTTPS.

I guess I need what cortesi described in this comment

@cortesi
Member
cortesi commented Jul 23, 2013

Hi Radoslav. Yes, that's precisely what's needed. This is on the todo list, but I won't get to it immediately. Please let me know if you want to tackle implementing this - happy to help and answer questions.

@mhils mhils closed this Dec 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment