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
fe9c86a9
Commit
fe9c86a9
authored
Feb 24, 2018
by
mohammadlachgar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix & Add property TrustRootCertificateAsAdministrator
parent
af0c17cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
MainWindow.xaml.cs
Examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs
+4
-4
ProxyServer.cs
Titanium.Web.Proxy/ProxyServer.cs
+12
-0
No files found.
Examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs
View file @
fe9c86a9
...
@@ -23,7 +23,7 @@ namespace Titanium.Web.Proxy.Examples.Wpf
...
@@ -23,7 +23,7 @@ namespace Titanium.Web.Proxy.Examples.Wpf
private
int
lastSessionNumber
;
private
int
lastSessionNumber
;
public
ObservableCollection
<
SessionListItem
>
Sessions
{
get
;
}
=
new
ObservableCollection
<
SessionListItem
>();
public
ObservableCollection
<
SessionListItem
>
Sessions
{
get
;
}
=
new
ObservableCollection
<
SessionListItem
>();
public
SessionListItem
SelectedSession
public
SessionListItem
SelectedSession
{
{
...
@@ -79,6 +79,9 @@ namespace Titanium.Web.Proxy.Examples.Wpf
...
@@ -79,6 +79,9 @@ namespace Titanium.Web.Proxy.Examples.Wpf
//Trust Root Certificate
//Trust Root Certificate
proxyServer
.
TrustRootCertificate
=
true
;
proxyServer
.
TrustRootCertificate
=
true
;
proxyServer
.
TrustRootCertificateAsAdministrator
=
true
;
proxyServer
.
ForwardToUpstreamGateway
=
true
;
////if you need Load or Create Certificate now. ////// "true" if you need Enable===> Trust the RootCertificate used by this proxy server
////if you need Load or Create Certificate now. ////// "true" if you need Enable===> Trust the RootCertificate used by this proxy server
//proxyServer.EnsureRootCertificate(true);
//proxyServer.EnsureRootCertificate(true);
...
@@ -89,9 +92,6 @@ namespace Titanium.Web.Proxy.Examples.Wpf
...
@@ -89,9 +92,6 @@ namespace Titanium.Web.Proxy.Examples.Wpf
////note : load now (if existed)
////note : load now (if existed)
//proxyServer.CertificateManager.LoadRootCertificate(@"C:\NameFolder\rootCert.pfx", "PfxPassword");
//proxyServer.CertificateManager.LoadRootCertificate(@"C:\NameFolder\rootCert.pfx", "PfxPassword");
proxyServer
.
CertificateManager
.
TrustRootCertificateAsAdministrator
();
proxyServer
.
ForwardToUpstreamGateway
=
true
;
var
explicitEndPoint
=
new
ExplicitProxyEndPoint
(
IPAddress
.
Any
,
8000
,
true
)
var
explicitEndPoint
=
new
ExplicitProxyEndPoint
(
IPAddress
.
Any
,
8000
,
true
)
{
{
ExcludedHttpsHostNameRegex
=
new
[]
{
"ssllabs.com"
},
ExcludedHttpsHostNameRegex
=
new
[]
{
"ssllabs.com"
},
...
...
Titanium.Web.Proxy/ProxyServer.cs
View file @
fe9c86a9
...
@@ -119,6 +119,13 @@ namespace Titanium.Web.Proxy
...
@@ -119,6 +119,13 @@ namespace Titanium.Web.Proxy
set
=>
CertificateManager
.
trustRootCertificate
=
value
;
set
=>
CertificateManager
.
trustRootCertificate
=
value
;
}
}
/// <summary>
/// Needs elevated permission. Works only on Windows.
/// <para>Puts the certificate to the local machine's certificate store.</para>
/// <para>Certutil.exe is a command-line program that is installed as part of Certificate Services</para>
/// </summary>
public
bool
TrustRootCertificateAsAdministrator
{
get
;
set
;
}
=
false
;
/// <summary>
/// <summary>
/// Save all fake certificates in folder "crts"(will be created in proxy dll directory)
/// Save all fake certificates in folder "crts"(will be created in proxy dll directory)
/// <para>for can load the certificate and not make new certificate every time </para>
/// <para>for can load the certificate and not make new certificate every time </para>
...
@@ -755,6 +762,11 @@ namespace Titanium.Web.Proxy
...
@@ -755,6 +762,11 @@ namespace Titanium.Web.Proxy
{
{
CertificateManager
.
TrustRootCertificate
();
CertificateManager
.
TrustRootCertificate
();
}
}
if
(
TrustRootCertificateAsAdministrator
)
{
CertificateManager
.
TrustRootCertificateAsAdministrator
();
}
}
}
}
}
...
...
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