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
b0d2cd22
Commit
b0d2cd22
authored
Dec 07, 2018
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#529 let generic certificate override in transparent endpoint
parent
315d3e20
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
ExplicitProxyEndPoint.cs
src/Titanium.Web.Proxy/Models/ExplicitProxyEndPoint.cs
+0
-5
ProxyEndPoint.cs
src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs
+7
-0
TransparentClientHandler.cs
src/Titanium.Web.Proxy/TransparentClientHandler.cs
+2
-1
No files found.
src/Titanium.Web.Proxy/Models/ExplicitProxyEndPoint.cs
View file @
b0d2cd22
...
@@ -27,11 +27,6 @@ namespace Titanium.Web.Proxy.Models
...
@@ -27,11 +27,6 @@ namespace Titanium.Web.Proxy.Models
internal
bool
IsSystemHttpsProxy
{
get
;
set
;
}
internal
bool
IsSystemHttpsProxy
{
get
;
set
;
}
/// <summary>
/// Generic certificate to use for SSL decryption.
/// </summary>
public
X509Certificate2
GenericCertificate
{
get
;
set
;
}
/// <summary>
/// <summary>
/// Intercept tunnel connect request.
/// Intercept tunnel connect request.
/// Valid only for explicit endpoints.
/// Valid only for explicit endpoints.
...
...
src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs
View file @
b0d2cd22
using
System.Net
;
using
System.Net
;
using
System.Net.Sockets
;
using
System.Net.Sockets
;
using
System.Security.Cryptography.X509Certificates
;
namespace
Titanium.Web.Proxy.Models
namespace
Titanium.Web.Proxy.Models
{
{
...
@@ -47,5 +48,11 @@ namespace Titanium.Web.Proxy.Models
...
@@ -47,5 +48,11 @@ namespace Titanium.Web.Proxy.Models
public
bool
IpV6Enabled
=>
Equals
(
IpAddress
,
IPAddress
.
IPv6Any
)
public
bool
IpV6Enabled
=>
Equals
(
IpAddress
,
IPAddress
.
IPv6Any
)
||
Equals
(
IpAddress
,
IPAddress
.
IPv6Loopback
)
||
Equals
(
IpAddress
,
IPAddress
.
IPv6Loopback
)
||
Equals
(
IpAddress
,
IPAddress
.
IPv6None
);
||
Equals
(
IpAddress
,
IPAddress
.
IPv6None
);
/// <summary>
/// Generic certificate to use for SSL decryption.
/// </summary>
public
X509Certificate2
GenericCertificate
{
get
;
set
;
}
}
}
}
}
src/Titanium.Web.Proxy/TransparentClientHandler.cs
View file @
b0d2cd22
...
@@ -81,7 +81,8 @@ namespace Titanium.Web.Proxy
...
@@ -81,7 +81,8 @@ namespace Titanium.Web.Proxy
sslStream
=
new
SslStream
(
clientStream
);
sslStream
=
new
SslStream
(
clientStream
);
string
certName
=
HttpHelper
.
GetWildCardDomainName
(
httpsHostName
);
string
certName
=
HttpHelper
.
GetWildCardDomainName
(
httpsHostName
);
var
certificate
=
await
CertificateManager
.
CreateCertificateAsync
(
certName
);
var
certificate
=
endPoint
.
GenericCertificate
??
await
CertificateManager
.
CreateCertificateAsync
(
certName
);
// Successfully managed to authenticate the client using the fake certificate
// Successfully managed to authenticate the client using the fake certificate
await
sslStream
.
AuthenticateAsServerAsync
(
certificate
,
false
,
SslProtocols
.
Tls
,
false
);
await
sslStream
.
AuthenticateAsServerAsync
(
certificate
,
false
,
SslProtocols
.
Tls
,
false
);
...
...
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