Slow SSL Handshakes
I'm using HAProxy to connect to a mitmdump reverse proxy in https2http mode. I'm seeing an additional 200ms+ latency for every request, which disappears when I set the proxy back to http mode. HAProxy opens and closes the connection for every request, so I highly suspect it's related to opening an SSL connection.
Right now I'm substituting http2http mode with Nginx to do SSL and proxy pass to mitmdump, and performance is good.
Below is a snippet of HAProxy configuration:
listen test ssl crt test.pem
bind *:443
mode http
balance roundrobin
server test localhost:443 check ssl verify none
Hi there,
There are some circumstances in which mitmproxy has to make two upstream SSL requests, and discard the first one. Please have a look at the "How mitmproxy works" page in the documentation, specifically the section on SNI, for the somewhat complicated details:
https://mitmproxy.org/doc/howmitmproxy.html
I'd also expect some overhead due to the extra SSL negotiation, even in the best case. So, I don't believe this is a bug per se - please drop by the developer Slack if you feel the performance situation here needs to be improved.
Cheers,
Aldo