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
204c4da6
Commit
204c4da6
authored
Sep 12, 2016
by
ilushka85
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
if reading from cached certs dont wait for semaphoreLock - improves speed and concurrency
parent
5820d484
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
CertificateManager.cs
Titanium.Web.Proxy/Network/CertificateManager.cs
+11
-2
No files found.
Titanium.Web.Proxy/Network/CertificateManager.cs
View file @
204c4da6
...
...
@@ -7,6 +7,7 @@ using System.Reflection;
using
System.Threading.Tasks
;
using
System.Threading
;
using
System.Linq
;
using
System.Collections.Concurrent
;
namespace
Titanium.Web.Proxy.Network
{
...
...
@@ -42,7 +43,7 @@ namespace Titanium.Web.Proxy.Network
MyStore
=
new
X509Store
(
StoreName
.
My
,
StoreLocation
.
CurrentUser
);
RootStore
=
new
X509Store
(
StoreName
.
Root
,
StoreLocation
.
CurrentUser
);
certificateCache
=
new
Dictionary
<
string
,
CachedCertificate
>();
certificateCache
=
new
Concurrent
Dictionary
<
string
,
CachedCertificate
>();
}
/// <summary>
...
...
@@ -92,7 +93,6 @@ namespace Titanium.Web.Proxy.Network
/// <returns></returns>
protected
async
virtual
Task
<
X509Certificate2
>
CreateCertificate
(
X509Store
store
,
string
certificateName
,
bool
isRootCertificate
)
{
await
semaphoreLock
.
WaitAsync
();
try
{
...
...
@@ -102,6 +102,15 @@ namespace Titanium.Web.Proxy.Network
cached
.
LastAccess
=
DateTime
.
Now
;
return
cached
.
Certificate
;
}
}
catch
{
}
await
semaphoreLock
.
WaitAsync
();
try
{
X509Certificate2
certificate
=
null
;
store
.
Open
(
OpenFlags
.
ReadWrite
);
...
...
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