Commit 112f764b authored by Bechny, Ondrej's avatar Bechny, Ondrej

CertificateManager in ProxyServer is created during ProxyServer start, not in...

CertificateManager in ProxyServer is created during ProxyServer start, not in the constructor, fixes #114
parent 3584b878
......@@ -131,9 +131,6 @@ namespace Titanium.Web.Proxy
RootCertificateName = RootCertificateName ?? "Titanium Root Certificate Authority";
RootCertificateIssuerName = RootCertificateIssuerName ?? "Titanium";
certificateCacheManager = new CertificateManager(RootCertificateIssuerName,
RootCertificateName);
}
/// <summary>
......@@ -265,6 +262,9 @@ namespace Titanium.Web.Proxy
throw new Exception("Proxy is already running.");
}
certificateCacheManager = new CertificateManager(RootCertificateIssuerName,
RootCertificateName);
certTrusted = certificateCacheManager.CreateTrustedRootCertificate().Result;
foreach (var endPoint in ProxyEndPoints)
......@@ -304,7 +304,7 @@ namespace Titanium.Web.Proxy
ProxyEndPoints.Clear();
certificateCacheManager.StopClearIdleCertificates();
certificateCacheManager?.StopClearIdleCertificates();
proxyRunning = false;
}
......@@ -420,7 +420,7 @@ namespace Titanium.Web.Proxy
Stop();
}
certificateCacheManager.Dispose();
certificateCacheManager?.Dispose();
}
}
}
\ No newline at end of file
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