使用代理,仅适用于特定的服务器证书

时间:2018-12-03 07:09:26

标签: c# proxy ssl-certificate x509certificate titanium-web-proxy

在Titanium-Web-Proxy中,可以排除您不想代理的Https地址。这些示例为此使用OnBeforeTunnelConnectRequest,但是目前只有该请求是已知的。

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;
    }
}

但是我需要从服务器证书中获取信息以排除地址。我只能在ServerCertificateValidationCallback中获得服务器证书,但是目前无法排除该地址。该怎么办?

0 个答案:

没有答案