Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Titanium-Web-Proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Titanium-Web-Proxy
Commits
25383a4f
Commit
25383a4f
authored
Jan 14, 2020
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
fcb8301f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
DefaultCertificateDiskCache.cs
...Titanium.Web.Proxy/Network/DefaultCertificateDiskCache.cs
+7
-15
No files found.
src/Titanium.Web.Proxy/Network/DefaultCertificateDiskCache.cs
View file @
25383a4f
...
...
@@ -6,13 +6,12 @@ using Titanium.Web.Proxy.Helpers;
namespace
Titanium.Web.Proxy.Network
{
internal
sealed
class
DefaultCertificateDiskCache
:
ICertificateCache
public
sealed
class
DefaultCertificateDiskCache
:
ICertificateCache
{
private
const
string
defaultCertificateDirectoryName
=
"crts"
;
private
const
string
defaultCertificateFileExtension
=
".pfx"
;
private
const
string
defaultRootCertificateFileName
=
"rootCert"
+
defaultCertificateFileExtension
;
private
string
?
rootCertificatePath
;
private
string
?
certificatePath
;
public
X509Certificate2
?
LoadRootCertificate
(
string
pathOrName
,
string
password
,
X509KeyStorageFlags
storageFlags
)
{
...
...
@@ -56,8 +55,6 @@ namespace Titanium.Web.Proxy.Network
{
// do nothing
}
certificatePath
=
null
;
}
private
X509Certificate2
?
loadCertificate
(
string
path
,
string
password
,
X509KeyStorageFlags
storageFlags
)
...
...
@@ -95,20 +92,15 @@ namespace Titanium.Web.Proxy.Network
private
string
getCertificatePath
(
bool
create
)
{
if
(
certificatePath
==
null
)
{
string
path
=
getRootCertificateDirectory
();
string
certPath
=
Path
.
Combine
(
path
,
defaultCertificateDirectoryName
);
if
(
create
&&
!
Directory
.
Exists
(
certPath
))
{
Directory
.
CreateDirectory
(
certPath
);
}
string
path
=
getRootCertificateDirectory
();
certificatePath
=
certPath
;
string
certPath
=
Path
.
Combine
(
path
,
defaultCertificateDirectoryName
);
if
(
create
&&
!
Directory
.
Exists
(
certPath
))
{
Directory
.
CreateDirectory
(
certPath
);
}
return
cert
ificate
Path
;
return
certPath
;
}
private
string
getRootCertificateDirectory
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment