Commit 25383a4f authored by Honfika's avatar Honfika

fix

parent fcb8301f
...@@ -6,13 +6,12 @@ using Titanium.Web.Proxy.Helpers; ...@@ -6,13 +6,12 @@ using Titanium.Web.Proxy.Helpers;
namespace Titanium.Web.Proxy.Network namespace Titanium.Web.Proxy.Network
{ {
internal sealed class DefaultCertificateDiskCache : ICertificateCache public sealed class DefaultCertificateDiskCache : ICertificateCache
{ {
private const string defaultCertificateDirectoryName = "crts"; private const string defaultCertificateDirectoryName = "crts";
private const string defaultCertificateFileExtension = ".pfx"; private const string defaultCertificateFileExtension = ".pfx";
private const string defaultRootCertificateFileName = "rootCert" + defaultCertificateFileExtension; private const string defaultRootCertificateFileName = "rootCert" + defaultCertificateFileExtension;
private string? rootCertificatePath; private string? rootCertificatePath;
private string? certificatePath;
public X509Certificate2? LoadRootCertificate(string pathOrName, string password, X509KeyStorageFlags storageFlags) public X509Certificate2? LoadRootCertificate(string pathOrName, string password, X509KeyStorageFlags storageFlags)
{ {
...@@ -56,8 +55,6 @@ namespace Titanium.Web.Proxy.Network ...@@ -56,8 +55,6 @@ namespace Titanium.Web.Proxy.Network
{ {
// do nothing // do nothing
} }
certificatePath = null;
} }
private X509Certificate2? loadCertificate(string path, string password, X509KeyStorageFlags storageFlags) private X509Certificate2? loadCertificate(string path, string password, X509KeyStorageFlags storageFlags)
...@@ -94,8 +91,6 @@ namespace Titanium.Web.Proxy.Network ...@@ -94,8 +91,6 @@ namespace Titanium.Web.Proxy.Network
} }
private string getCertificatePath(bool create) private string getCertificatePath(bool create)
{
if (certificatePath == null)
{ {
string path = getRootCertificateDirectory(); string path = getRootCertificateDirectory();
...@@ -105,10 +100,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -105,10 +100,7 @@ namespace Titanium.Web.Proxy.Network
Directory.CreateDirectory(certPath); Directory.CreateDirectory(certPath);
} }
certificatePath = certPath; return certPath;
}
return certificatePath;
} }
private string getRootCertificateDirectory() private string getRootCertificateDirectory()
......
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