Commit c5496072 authored by justcoding121's avatar justcoding121 Committed by justcoding121

#135 Fix AppDomain issue for loading pfx

parent 763b4e61
...@@ -42,7 +42,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -42,7 +42,7 @@ namespace Titanium.Web.Proxy.Network
internal X509Certificate2 GetRootCertificate() internal X509Certificate2 GetRootCertificate()
{ {
var fileName = Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "rootCert.pfx"); var fileName = Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "rootCert.pfx");
if (File.Exists(fileName)) if (File.Exists(fileName))
{ {
...@@ -83,7 +83,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -83,7 +83,7 @@ namespace Titanium.Web.Proxy.Network
{ {
try try
{ {
var fileName = Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "rootCert.pfx"); var fileName = Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "rootCert.pfx");
File.WriteAllBytes(fileName, rootCertificate.Export(X509ContentType.Pkcs12)); File.WriteAllBytes(fileName, rootCertificate.Export(X509ContentType.Pkcs12));
} }
catch(Exception e) catch(Exception e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment