Search code examples
httpsproxysquid

Is it possible to replace a https url through a proxy?


I'm trying to replace an https url through a local proxy (I am using squid on mac osx) so that when I execute something like curl https://www.site1.com/textfile.txt I get the contents of https://www.site2.com/textfile.txt instead. With http everything works without problems, but with https I first get (understandably) complaints about mismatching https certificates, and when I tell curl to ignore those errors with the -k parameter, I get a 404 not found error instead.

Is this something just not possible to do with https or there's a way around it?


Solution

  • If it works with Http, then it should virtually be the same with https.

    Although, I'm not sure what you mean by "rewrite". You can just swap the endpoints and do what you what to do, tho.

    But if you want to intercept your request then you can look through mitmproxy. It is a free and open source interactive HTTPS proxy, which can help you to solve your problem.