0

我已将 Titanium Web 代理用于 Windows 窗体应用程序,并在那里拦截 https 流量并对其进行更新。我第一次使用钛根证书,效果很好。
当我尝试使用自定义 ssl 证书时,如下所示

proxyServer.CertificateManager.RootCertificate = new X509Certificate2("default.pfx", 
                    "password",
                    X509KeyStorageFlags.MachineKeySet);

proxyServer.CertificateManager.TrustRootCertificate(true);

但我无法解密 https 流量,它说

"The underlying connection was closed: An unexpected error occurred on a send." innerException says "  
Authentication failed because the remote party has closed the transport stream."

如何在 Titan -web 代理中使用自定义 ssl 证书解密 https 流量。

4

1 回答 1

0

当我将自定义证书名称和颁发者名称添加到代理服务器构造函数并且不需要任何上述代码时,问题已得到解决。刚刚通过以下代码解决了问题,并且需要在机器中安装证书

ProxyServer proxyServer = new ProxyServer("certificate.pfx", "Issuer Name",true,true,true);
proxyServer.CertificateManager.PfxPassword = "Password";
于 2019-05-29T08:37:02.220 回答