Skip to content

HTTPS to punch through "anti"‐virus software

Tinspin edited this page Jul 10, 2023 · 5 revisions

PileOfJunkMail made a HTTPS proxy workaround for fuse:

In the Fuse class, replace push/pull/stream instance variables with:

`private TcpClient pullClient;`
`private TcpClient pushClient;`
`private SslStream pullStream;`
`private SslStream pushStream;`

Update the Connect and Push methods:

`private void Connect()`
`{`
    `this.first = true;`
    `this.pushClient = new TcpClient();`
    `this.pushClient.NoDelay = true;`
    `this.pushClient.ReceiveTimeout = 1000;`
    `this.pushClient.Connect(this.remote);`
    `this.pushStream = new SslStream(this.pushClient.GetStream(), false, new RemoteCertificateValidationCallback(Fuse.ValidateCert));`
    `this.pushStream.AuthenticateAsClient(this.host);`
`}`

`public void Pull(string salt)`
`{`
    `this.salt = salt;`
    `this.pullClient = new TcpClient();`
    `this.pullClient.NoDelay = true;`
    `this.pullClient.Connect(this.remote);`
    `string s = /* unchanged */;`
    `this.pullStream = new SslStream(this.pullClient.GetStream(), false, new RemoteCertificateValidationCallback(Fuse.ValidateCert));`
    `this.pullStream.AuthenticateAsClient(this.host);`
    `byte[] bytes = Encoding.UTF8.GetBytes(s);`
    `this.pullStream.Write(bytes, 0, bytes.Length);`
    `new Thread(new ThreadStart(this.PullSync)).Start();`
    `this.connected = true;`
`}`

`public static bool ValidateCert(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)`
`{`
    `return true;`
`}`

And after that update the other code in the class to use the Stream objects rather than the Socket objects.

Clone this wiki locally