Hi guys, we have an old program that we use to batch upload credit card payments. Daily, it uploads a file to our credit card processor with that day’s customer CC data. Unfortunately it uses tls 1.1 (1.0?) to do so. Our cc processor recently announced that they will (rightfully) be dropping support for that.
So, we were hoping to use MITMproxy to “bump” up this software’s comms to 1.2. Does MITMproxy support this? How would I accomplish that?
So basically:
old software -> tls1.1 -> mitmproxy -> 1.2 -> internet -> payment processor
So, we were hoping to use MITMproxy to “bump” up this software’s comms to 1.2. Does MITMproxy support this?
Yes. This is supported and encouraged. You would just run mitmproxy as a regular or reverse proxy (depends on what you can configure easily). Mitmproxy will negotiate the strongest possible encryption individually on both ends. One caveat is that your client needs to send a Server Name Indication TLS extension, which may not be the case with very old software (Cannot validate certificate hostname without SNI · Issue #1846 · mitmproxy/mitmproxy · GitHub).
That worked!
Now, I need help with another matter (and can create a new thread if you want). Apparently, as part of the switch to TLS 1.2, our payment processor has a new domain that we need to communicate with. There’s no easy way to switch to the new domain as it is hardcoded in our software. Can mitmproxy do this for us?
I gave that script a try, while it definitely runs, it does not seem to work.
"""
This example shows two ways to redirect flows to another server.
"""
from mitmproxy import http
def request(flow: http.HTTPFlow) -> None:
# pretty_host takes the "Host" header of the request into account,
# which is useful in transparent mode where we usually only have the IP
# otherwise.
if flow.request.pretty_host == "myvirtualmerchant.com":
flow.request.host = "api.convergepay.com"
When I go to myvirtualmerchant.com, it does not forward me to the new site like it should. It simply takes me to the old site, it’s almost like script isn’t there at all. No change.