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
3adf9856
Unverified
Commit
3adf9856
authored
Feb 23, 2018
by
mohammadlachgar
Committed by
GitHub
Feb 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete spaces and new lines(entr)
parent
7f5b5d52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
17 deletions
+11
-17
CertificateManager.cs
Titanium.Web.Proxy/Network/CertificateManager.cs
+11
-17
No files found.
Titanium.Web.Proxy/Network/CertificateManager.cs
View file @
3adf9856
...
...
@@ -93,7 +93,7 @@ namespace Titanium.Web.Proxy.Network
private
readonly
IDictionary
<
string
,
CachedCertificate
>
certificateCache
;
private
readonly
Action
<
Exception
>
exceptionFunc
;
internal
string
Issuer
{
get
=>
issuer
??
defaultRootCertificateIssuer
;
...
...
@@ -201,15 +201,15 @@ namespace Titanium.Web.Proxy.Network
return
null
;
}
}
/// <summary>
/// Attempts to create a RootCertificate
/// </summary>
/// <param name="persistToFile">if set to <c>true</c> try to load/save the certificate from rootCert.pfx.</param>
/// <returns>
/// true if succeeded, else false
/// </returns>
public
bool
CreateTrustedRootCertificate
(
bool
persistToFile
=
true
)
/// <summary>
/// Attempts to create a RootCertificate
/// </summary>
/// <param name="persistToFile">if set to <c>true</c> try to load/save the certificate from rootCert.pfx.</param>
/// <returns>
/// true if succeeded, else false
/// </returns>
public
bool
CreateTrustedRootCertificate
(
bool
persistToFile
=
true
)
{
if
(
persistToFile
&&
RootCertificate
==
null
)
{
...
...
@@ -455,9 +455,7 @@ namespace Titanium.Web.Proxy.Network
{
try
{
if
((
isRootCertificate
==
false
)
&&
(
saveFakeCertificates
==
true
))
{
string
path
=
GetCertPath
();
string
subjectName
=
System
.
Text
.
RegularExpressions
.
Regex
.
Replace
(
certificateName
,
@"^CN\s*=\s*"
,
""
,
System
.
Text
.
RegularExpressions
.
RegexOptions
.
IgnoreCase
);
subjectName
=
subjectName
.
Replace
(
"*"
,
"$x$"
);
...
...
@@ -480,12 +478,8 @@ namespace Titanium.Web.Proxy.Network
}
}
else
{
certificate
=
this
.
makeCertificate
(
certificateName
,
isRootCertificate
);
}
}
catch
(
Exception
e
)
{
...
...
@@ -580,7 +574,7 @@ namespace Titanium.Web.Proxy.Network
x509PersonalStore
.
Close
();
}
}
/// <summary>
/// Remove the Root Certificate trust
/// </summary>
...
...
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