titanium-web-proxy icon indicating copy to clipboard operation
titanium-web-proxy copied to clipboard

Using Custom SSL Certificates

Open dynamicritz opened this issue 5 years ago • 3 comments

Hi, I have a .pfx file along with its password obviously... I want to use this while decrypting SSL. This is what I do:

var proxyServer = new ProxyServer("path/to/.pfx_file", "Issuer Name", true, true, true);
proxyServer.CertificateManager.PfxPassword = "password";
var httpProxy = new ExplicitProxyEndPoint(IPAddress.Parse(IP), Port, decryptSsl: true);
proxyServer.AddEndPoint(httpProxy);
proxyServer.BeforeRequest += OnBeforeRequest;
proxyServer.BeforeResponse += OnBeforeResponse;
proxyServer.AfterResponse += OnAfterResponse;

proxyServer.Start();

I had put this .pfx certificate in the client's Trusted Certificate Store. While accessing the proxy from the client it does not work... Shows security issue

dynamicritz avatar Jun 13 '20 07:06 dynamicritz

The first parameter in ProxyServer is not a path, the name of the root certificate to lookUp. If I recall right it looks at the execution directory where the proxy.dll is located.

You can take a look at certificate manager for details. To use a pfx path directly, I think you would need to set call below method, before starting the proxy.

proxyServer.CertificateManager.LoadRootCertificate(pfxFilePath, password, false);

See CertificateManager implementation in below link for details.

https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Certificates/CertificateManager.cs

justcoding121 avatar Jun 16 '20 02:06 justcoding121

See CertificateManager API docs below.

https://justcoding121.github.io/Titanium-Web-Proxy/docs/api/Titanium.Web.Proxy.Network.CertificateManager.html

justcoding121 avatar Jun 16 '20 02:06 justcoding121

It would be nice if you could post a code segment for my use-case... I tried various methods but it seems I am not doing it the correct way

dynamicritz avatar Jun 22 '20 11:06 dynamicritz