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
c244b2b6
Commit
c244b2b6
authored
Mar 02, 2016
by
titanium007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
override root cert if specified
parent
dee6d59f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
ProxyServer.cs
Titanium.Web.Proxy/ProxyServer.cs
+11
-6
No files found.
Titanium.Web.Proxy/ProxyServer.cs
View file @
c244b2b6
...
@@ -21,7 +21,7 @@ namespace Titanium.Web.Proxy
...
@@ -21,7 +21,7 @@ namespace Titanium.Web.Proxy
/// </summary>
/// </summary>
public
partial
class
ProxyServer
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
string
[]
ColonSpaceSplit
=
{
": "
};
...
@@ -34,17 +34,16 @@ namespace Titanium.Web.Proxy
...
@@ -34,17 +34,16 @@ namespace Titanium.Web.Proxy
private
static
readonly
byte
[]
ChunkEnd
=
private
static
readonly
byte
[]
ChunkEnd
=
Encoding
.
ASCII
.
GetBytes
(
0.
ToString
(
"x2"
)
+
Environment
.
NewLine
+
Environment
.
NewLine
);
Encoding
.
ASCII
.
GetBytes
(
0.
ToString
(
"x2"
)
+
Environment
.
NewLine
+
Environment
.
NewLine
);
public
static
readonly
int
BUFFER_SIZE
=
8192
;
#if NET45
#if NET45
internal
static
SslProtocols
SupportedProtocols
=
SslProtocols
.
Tls
|
SslProtocols
.
Tls11
|
SslProtocols
.
Tls12
|
SslProtocols
.
Ssl3
;
internal
static
SslProtocols
SupportedProtocols
=
SslProtocols
.
Tls
|
SslProtocols
.
Tls11
|
SslProtocols
.
Tls12
|
SslProtocols
.
Ssl3
;
#else
#else
public
static
SslProtocols
SupportedProtocols
=
SslProtocols
.
Tls
|
SslProtocols
.
Ssl3
;
internal
static
SslProtocols
SupportedProtocols
=
SslProtocols
.
Tls
|
SslProtocols
.
Ssl3
;
#endif
#endif
static
ProxyServer
()
static
ProxyServer
()
{
{
CertManager
=
new
CertificateManager
(
"Titanium"
,
"Titanium Root Certificate Authority"
);
ProxyEndPoints
=
new
List
<
ProxyEndPoint
>();
ProxyEndPoints
=
new
List
<
ProxyEndPoint
>();
Initialize
();
Initialize
();
...
@@ -55,6 +54,7 @@ namespace Titanium.Web.Proxy
...
@@ -55,6 +54,7 @@ namespace Titanium.Web.Proxy
private
static
bool
certTrusted
{
get
;
set
;
}
private
static
bool
certTrusted
{
get
;
set
;
}
private
static
bool
proxyRunning
{
get
;
set
;
}
private
static
bool
proxyRunning
{
get
;
set
;
}
public
static
string
RootCertificateIssuerName
{
get
;
set
;
}
public
static
string
RootCertificateName
{
get
;
set
;
}
public
static
string
RootCertificateName
{
get
;
set
;
}
public
static
event
EventHandler
<
SessionEventArgs
>
BeforeRequest
;
public
static
event
EventHandler
<
SessionEventArgs
>
BeforeRequest
;
...
@@ -123,7 +123,6 @@ namespace Titanium.Web.Proxy
...
@@ -123,7 +123,6 @@ namespace Titanium.Web.Proxy
//clear any settings previously added
//clear any settings previously added
ProxyEndPoints
.
OfType
<
ExplicitProxyEndPoint
>().
ToList
().
ForEach
(
x
=>
x
.
IsSystemHttpsProxy
=
false
);
ProxyEndPoints
.
OfType
<
ExplicitProxyEndPoint
>().
ToList
().
ForEach
(
x
=>
x
.
IsSystemHttpsProxy
=
false
);
RootCertificateName
=
RootCertificateName
??
"Titanium_Proxy_Test_Root"
;
//If certificate was trusted by the machine
//If certificate was trusted by the machine
if
(
certTrusted
)
if
(
certTrusted
)
...
@@ -156,6 +155,12 @@ namespace Titanium.Web.Proxy
...
@@ -156,6 +155,12 @@ namespace Titanium.Web.Proxy
if
(
proxyRunning
)
if
(
proxyRunning
)
throw
new
Exception
(
"Proxy is already running."
);
throw
new
Exception
(
"Proxy is already running."
);
RootCertificateName
=
RootCertificateName
??
"Titanium Root Certificate Authority"
;
RootCertificateIssuerName
=
RootCertificateIssuerName
??
"Titanium"
;
CertManager
=
new
CertificateManager
(
RootCertificateIssuerName
,
RootCertificateName
);
EnableSsl
=
ProxyEndPoints
.
Any
(
x
=>
x
.
EnableSsl
);
EnableSsl
=
ProxyEndPoints
.
Any
(
x
=>
x
.
EnableSsl
);
if
(
EnableSsl
)
if
(
EnableSsl
)
...
...
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