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
33ec65f4
Unverified
Commit
33ec65f4
authored
Feb 22, 2018
by
mohammadlachgar
Committed by
GitHub
Feb 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now you can Change path rootCert.pfx
Now you can Change path rootCert.pfx ,name and password
parent
150d7595
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
MainWindow.xaml.cs
Examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs
+19
-8
No files found.
Examples/Titanium.Web.Proxy.Examples.Wpf/MainWindow.xaml.cs
View file @
33ec65f4
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Collections.ObjectModel
;
using
System.Linq
;
using
System.Linq
;
...
@@ -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
{
{
...
@@ -65,27 +65,36 @@ namespace Titanium.Web.Proxy.Examples.Wpf
...
@@ -65,27 +65,36 @@ namespace Titanium.Web.Proxy.Examples.Wpf
//proxyServer.CertificateEngine = CertificateEngine.DefaultWindows;
//proxyServer.CertificateEngine = CertificateEngine.DefaultWindows;
//add password to rootCert.pfx
//add password to rootCert.pfx
//proxyServer.Password_rootCert = "
My
Password";
//proxyServer.Password_rootCert = "
Pfx
Password";
//save all fake certificates in folder "crts"(will be save in proxy dll directory)
//save all fake certificates in folder "crts"(will be save in proxy dll directory)
//if create new rootCert.pfx ====> delete folder "crts"
//proxyServer.SaveFakeCertificates = true;
//proxyServer.SaveFakeCertificates = true;
//
proxyServer.TrustRootCertificate = true;
proxyServer
.
TrustRootCertificate
=
true
;
//or if you need Load or Create Certificate now. ////// "true" if you need Enable===> Trust the RootCertificate used by this proxy server
//or 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);
//or load directly certificate(As Administrator if need this)
//and At the same time chose path and password
//if doesn't exist file or password is incorect and (overwriteRootCert=true) ====> create new pfx file
//note : load now (if existed)
//proxyServer.CertificateManager.LoadRootCertificate(@"C:\NameFolder\rootCert.pfx", "PfxPassword");
//or set info to load certificate (As Administrator if need this)
//Will not (load or create) certificate Before call function CreateTrustedRootCertificate
//proxyServer.CertificateManager.SetInfo_LoadRootCertificate(@"C:\NameFolder\rootCert.pfx", "PfxPassword");
//proxyServer.CertificateManager.TrustRootCertificateAsAdministrator();
//proxyServer.CertificateManager.TrustRootCertificateAsAdministrator();
proxyServer
.
ForwardToUpstreamGateway
=
true
;
//
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" },
//IncludedHttpsHostNameRegex = new string[0],
//IncludedHttpsHostNameRegex = new string[0],
};
};
...
@@ -104,7 +113,9 @@ namespace Titanium.Web.Proxy.Examples.Wpf
...
@@ -104,7 +113,9 @@ namespace Titanium.Web.Proxy.Examples.Wpf
proxyServer
.
TunnelConnectResponse
+=
ProxyServer_TunnelConnectResponse
;
proxyServer
.
TunnelConnectResponse
+=
ProxyServer_TunnelConnectResponse
;
proxyServer
.
ClientConnectionCountChanged
+=
delegate
{
Dispatcher
.
Invoke
(()
=>
{
ClientConnectionCount
=
proxyServer
.
ClientConnectionCount
;
});
};
proxyServer
.
ClientConnectionCountChanged
+=
delegate
{
Dispatcher
.
Invoke
(()
=>
{
ClientConnectionCount
=
proxyServer
.
ClientConnectionCount
;
});
};
proxyServer
.
ServerConnectionCountChanged
+=
delegate
{
Dispatcher
.
Invoke
(()
=>
{
ServerConnectionCount
=
proxyServer
.
ServerConnectionCount
;
});
};
proxyServer
.
ServerConnectionCountChanged
+=
delegate
{
Dispatcher
.
Invoke
(()
=>
{
ServerConnectionCount
=
proxyServer
.
ServerConnectionCount
;
});
};
proxyServer
.
Start
();
proxyServer
.
Start
();
proxyServer
.
SetAsSystemProxy
(
explicitEndPoint
,
ProxyProtocolType
.
AllHttp
);
proxyServer
.
SetAsSystemProxy
(
explicitEndPoint
,
ProxyProtocolType
.
AllHttp
);
...
...
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