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
58cbb338
Commit
58cbb338
authored
Oct 11, 2015
by
titanium007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug in setting certificate
parent
98fba874
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
Program.cs
Titanium.Web.Proxy.Test/Program.cs
+7
-9
ProxyServer.cs
Titanium.Web.Proxy/ProxyServer.cs
+11
-7
No files found.
Titanium.Web.Proxy.Test/Program.cs
View file @
58cbb338
...
...
@@ -43,16 +43,14 @@ namespace Titanium.Web.Proxy.Test
private
static
bool
ConsoleEventCallback
(
int
eventType
)
{
if
(
eventType
==
2
)
if
(
eventType
!=
2
)
return
false
;
try
{
try
{
Controller
.
Stop
();
}
catch
{
// ignored
}
Controller
.
Stop
();
}
catch
{
// ignored
}
return
false
;
}
...
...
Titanium.Web.Proxy/ProxyServer.cs
View file @
58cbb338
...
...
@@ -18,10 +18,10 @@ namespace Titanium.Web.Proxy
public
partial
class
ProxyServer
{
private
static
readonly
int
BUFFER_SIZE
=
8192
;
private
static
readonly
char
[]
SemiSplit
=
{
';'
};
private
static
readonly
char
[]
SemiSplit
=
{
';'
};
private
static
readonly
string
[]
ColonSpaceSplit
=
{
": "
};
private
static
readonly
char
[]
SpaceSplit
=
{
' '
};
private
static
readonly
string
[]
ColonSpaceSplit
=
{
": "
};
private
static
readonly
char
[]
SpaceSplit
=
{
' '
};
private
static
readonly
Regex
CookieSplitRegEx
=
new
Regex
(
@",(?! )"
);
...
...
@@ -62,8 +62,8 @@ namespace Titanium.Web.Proxy
ServicePointManager
.
Expect100Continue
=
false
;
WebRequest
.
DefaultWebProxy
=
null
;
ServicePointManager
.
DefaultConnectionLimit
=
10
;
ServicePointManager
.
DnsRefreshTimeout
=
3
*
60
*
1000
;
//3 minutes
ServicePointManager
.
MaxServicePointIdleTime
=
3
*
60
*
1000
;
ServicePointManager
.
DnsRefreshTimeout
=
3
*
60
*
1000
;
//3 minutes
ServicePointManager
.
MaxServicePointIdleTime
=
3
*
60
*
1000
;
//HttpWebRequest certificate validation callback
ServicePointManager
.
ServerCertificateValidationCallback
=
...
...
@@ -85,10 +85,15 @@ namespace Titanium.Web.Proxy
_listener
=
new
TcpListener
(
ListeningIpAddress
,
ListeningPort
);
_listener
.
Start
();
ListeningPort
=
((
IPEndPoint
)
_listener
.
LocalEndpoint
).
Port
;
ListeningPort
=
((
IPEndPoint
)
_listener
.
LocalEndpoint
).
Port
;
// accept clients asynchronously
_listener
.
BeginAcceptTcpClient
(
OnAcceptConnection
,
_listener
);
var
certTrusted
=
false
;
if
(
EnableSsl
)
certTrusted
=
CertManager
.
CreateTrustedRootCertificate
();
if
(
SetAsSystemProxy
)
{
SystemProxyHelper
.
EnableProxyHttp
(
...
...
@@ -100,7 +105,6 @@ namespace Titanium.Web.Proxy
{
RootCertificateName
=
RootCertificateName
??
"Titanium_Proxy_Test_Root"
;
var
certTrusted
=
CertManager
.
CreateTrustedRootCertificate
();
//If certificate was trusted by the machine
if
(
certTrusted
)
{
...
...
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