Skip to content

Instantly share code, notes, and snippets.

@jennings
Last active August 17, 2018 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jennings/811d471a713a4a96974c462398d29a5c to your computer and use it in GitHub Desktop.
Save jennings/811d471a713a4a96974c462398d29a5c to your computer and use it in GitHub Desktop.
Terminating TLS/SSL with Fiddler
static function redirectHttpsToHttp(oSession: Session, fromHost, toHost) {
if (oSession.HostnameIs(fromHost))
{
// Handle CONNECT Tunnels
if (oSession.HTTPMethodIs("CONNECT"))
{
oSession["x-replywithtunnel"] = "FakeTunnel";
return true;
}
oSession.fullUrl = "http://" + toHost + oSession.PathAndQuery;
}
return false;
}
static function OnBeforeRequest(oSession: Session) {
var shouldReturn = false;
shouldReturn = shouldReturn || redirectHttpsToHttp(oSession, "from-host.example.com", "to-host.autoalert.com");
if (shouldReturn) {
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment