How to redirect an HTTP URL to HTTPS in Windows?

2

I need to force a program on my Windows 10 to use HTTPS when connecting to its server because HTTP version of that address is blocked on my network. I basically need to add an "S" to the URL. I know the address it needs to connect to, i've been using Fiddler to monitor the requests, is it possible to do this using Fiddler? apparently it's impossible to do it with Windows hosts file.

user430418

Posted 2018-12-27T11:13:22.127

Reputation:

Answers

1

It is possible to use Fiddler for that, as described in the article Fiddler’s custom rules – how to replace protocol or domain in fiddler:

Open “Custom rules”, find this method

static function OnBeforeRequest(oSession: Session)

add to the beginning of the method the following code:

// Custom rules:
if (oSession.HostnameIs("mikitamanko.com") 
    || oSession.HostnameIs("google.com") 
    || oSession.HostnameIs("bing.com")) {
    oSession.fullUrl = "https" + oSession.fullUrl.Substring(oSession.fullUrl.IndexOf(':'));
}

This will replace protocol for sites listed in code.

A hacking solution would be to use a hex editor to modify the URL in the program's .exe file. A list of hex editors can be found in the article Best Free Hex Editor. This will work only if the program is not digitally signed.

harrymc

Posted 2018-12-27T11:13:22.127

Reputation: 306 093

Thank you so much, worked perfect. btw does running Fiddler in the background all time cause any performance issue ? such as in networking, ping times or overall performance? – None – 2018-12-27T14:07:38.707

2It adds one more waypoint for your requests, so will slow them down, but the delay is probably only measured in milliseconds. – harrymc – 2018-12-27T14:09:29.833