In Titanium-Web-Proxy is possible to exclude Https addresses you don't want to proxy. The examples use the OnBeforeTunnelConnectRequest for this, but at this moment only the request is known.
private async Task OnBeforeTunnelConnectRequest(object sender, TunnelConnectSessionEventArgs e)
{
string hostname = e.HttpClient.Request.RequestUri.Host;
await WriteToConsole("Tunnel to: " + hostname);
if (hostname.Contains("dropbox.com"))
{
// Exclude Https addresses you don't want to proxy
// Useful for clients that use certificate pinning
// for example dropbox.com
e.DecryptSsl = false;
}
}
But I need to get information from the server certificate to exclude the address. I can get the server certificate only in ServerCertificateValidationCallback
, but at this moment I can not exclude the address. How can this be done?