Unverified Commit 29901cf9 authored by Jehonathan Thomas's avatar Jehonathan Thomas Committed by GitHub

Merge pull request #531 from justcoding121/master

Generic certificate for transparent endpoint
parents 7b0d41f5 10e7e544
......@@ -107,6 +107,9 @@ So client application know that it is communicating with a proxy server.</p>
<div>
<a class="xref" href="Titanium.Web.Proxy.Models.ProxyEndPoint.html#Titanium_Web_Proxy_Models_ProxyEndPoint_IpV6Enabled">ProxyEndPoint.IpV6Enabled</a>
</div>
<div>
<a class="xref" href="Titanium.Web.Proxy.Models.ProxyEndPoint.html#Titanium_Web_Proxy_Models_ProxyEndPoint_GenericCertificate">ProxyEndPoint.GenericCertificate</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.tostring#System_Object_ToString">Object.ToString()</a>
</div>
......@@ -183,39 +186,6 @@ So client application know that it is communicating with a proxy server.</p>
</tr>
</tbody>
</table>
<h3 id="properties">Properties
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Models_ExplicitProxyEndPoint_GenericCertificate.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.GenericCertificate%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ExplicitProxyEndPoint.cs/#L33">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Models_ExplicitProxyEndPoint_GenericCertificate_" data-uid="Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.GenericCertificate*"></a>
<h4 id="Titanium_Web_Proxy_Models_ExplicitProxyEndPoint_GenericCertificate" data-uid="Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.GenericCertificate">GenericCertificate</h4>
<div class="markdown level1 summary"><p>Generic certificate to use for SSL decryption.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public X509Certificate2 GenericCertificate { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2">X509Certificate2</a></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="events">Events
</h3>
<span class="small pull-right mobile-hide">
......@@ -223,7 +193,7 @@ So client application know that it is communicating with a proxy server.</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Models_ExplicitProxyEndPoint_BeforeTunnelConnectRequest.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.BeforeTunnelConnectRequest%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ExplicitProxyEndPoint.cs/#L41">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ExplicitProxyEndPoint.cs/#L36">View Source</a>
</span>
<h4 id="Titanium_Web_Proxy_Models_ExplicitProxyEndPoint_BeforeTunnelConnectRequest" data-uid="Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.BeforeTunnelConnectRequest">BeforeTunnelConnectRequest</h4>
<div class="markdown level1 summary"><p>Intercept tunnel connect request.
......@@ -256,7 +226,7 @@ should&apos;nt be decrypted and instead be relayed.</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Models_ExplicitProxyEndPoint_BeforeTunnelConnectResponse.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.BeforeTunnelConnectResponse%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ExplicitProxyEndPoint.cs/#L47">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ExplicitProxyEndPoint.cs/#L42">View Source</a>
</span>
<h4 id="Titanium_Web_Proxy_Models_ExplicitProxyEndPoint_BeforeTunnelConnectResponse" data-uid="Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.BeforeTunnelConnectResponse">BeforeTunnelConnectResponse</h4>
<div class="markdown level1 summary"><p>Intercept tunnel connect response.
......
......@@ -130,7 +130,7 @@
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Models_ProxyEndPoint__ctor_System_Net_IPAddress_System_Int32_System_Boolean_.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Models.ProxyEndPoint.%23ctor(System.Net.IPAddress%2CSystem.Int32%2CSystem.Boolean)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs/#L17">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs/#L18">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Models_ProxyEndPoint__ctor_" data-uid="Titanium.Web.Proxy.Models.ProxyEndPoint.#ctor*"></a>
<h4 id="Titanium_Web_Proxy_Models_ProxyEndPoint__ctor_System_Net_IPAddress_System_Int32_System_Boolean_" data-uid="Titanium.Web.Proxy.Models.ProxyEndPoint.#ctor(System.Net.IPAddress,System.Int32,System.Boolean)">ProxyEndPoint(IPAddress, Int32, Boolean)</h4>
......@@ -175,7 +175,7 @@
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Models_ProxyEndPoint_DecryptSsl.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Models.ProxyEndPoint.DecryptSsl%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs/#L42">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs/#L43">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Models_ProxyEndPoint_DecryptSsl_" data-uid="Titanium.Web.Proxy.Models.ProxyEndPoint.DecryptSsl*"></a>
<h4 id="Titanium_Web_Proxy_Models_ProxyEndPoint_DecryptSsl" data-uid="Titanium.Web.Proxy.Models.ProxyEndPoint.DecryptSsl">DecryptSsl</h4>
......@@ -201,12 +201,43 @@
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Models_ProxyEndPoint_GenericCertificate.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Models.ProxyEndPoint.GenericCertificate%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs/#L56">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Models_ProxyEndPoint_GenericCertificate_" data-uid="Titanium.Web.Proxy.Models.ProxyEndPoint.GenericCertificate*"></a>
<h4 id="Titanium_Web_Proxy_Models_ProxyEndPoint_GenericCertificate" data-uid="Titanium.Web.Proxy.Models.ProxyEndPoint.GenericCertificate">GenericCertificate</h4>
<div class="markdown level1 summary"><p>Generic certificate to use for SSL decryption.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public X509Certificate2 GenericCertificate { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2">X509Certificate2</a></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Models_ProxyEndPoint_IpAddress.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Models.ProxyEndPoint.IpAddress%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs/#L32">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs/#L33">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Models_ProxyEndPoint_IpAddress_" data-uid="Titanium.Web.Proxy.Models.ProxyEndPoint.IpAddress*"></a>
<h4 id="Titanium_Web_Proxy_Models_ProxyEndPoint_IpAddress" data-uid="Titanium.Web.Proxy.Models.ProxyEndPoint.IpAddress">IpAddress</h4>
......@@ -237,7 +268,7 @@
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Models_ProxyEndPoint_IpV6Enabled.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Models.ProxyEndPoint.IpV6Enabled%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs/#L47">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs/#L48">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Models_ProxyEndPoint_IpV6Enabled_" data-uid="Titanium.Web.Proxy.Models.ProxyEndPoint.IpV6Enabled*"></a>
<h4 id="Titanium_Web_Proxy_Models_ProxyEndPoint_IpV6Enabled" data-uid="Titanium.Web.Proxy.Models.ProxyEndPoint.IpV6Enabled">IpV6Enabled</h4>
......@@ -268,7 +299,7 @@
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Models_ProxyEndPoint_Port.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Models.ProxyEndPoint.Port%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs/#L37">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs/#L38">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Models_ProxyEndPoint_Port_" data-uid="Titanium.Web.Proxy.Models.ProxyEndPoint.Port*"></a>
<h4 id="Titanium_Web_Proxy_Models_ProxyEndPoint_Port" data-uid="Titanium.Web.Proxy.Models.ProxyEndPoint.Port">Port</h4>
......@@ -305,7 +336,7 @@
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Models_ProxyEndPoint.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Models.ProxyEndPoint%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
</li>
<li>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs/#L9" class="contribution-link">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Models/ProxyEndPoint.cs/#L10" class="contribution-link">View Source</a>
</li>
</ul>
</div>
......
......@@ -107,6 +107,9 @@ Useful when requests are redirected to this proxy end point through port forward
<div>
<a class="xref" href="Titanium.Web.Proxy.Models.ProxyEndPoint.html#Titanium_Web_Proxy_Models_ProxyEndPoint_IpV6Enabled">ProxyEndPoint.IpV6Enabled</a>
</div>
<div>
<a class="xref" href="Titanium.Web.Proxy.Models.ProxyEndPoint.html#Titanium_Web_Proxy_Models_ProxyEndPoint_GenericCertificate">ProxyEndPoint.GenericCertificate</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.tostring#System_Object_ToString">Object.ToString()</a>
</div>
......
This diff is collapsed.
......@@ -2519,19 +2519,6 @@ references:
commentId: E:Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.BeforeTunnelConnectResponse
fullName: Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.BeforeTunnelConnectResponse
nameWithType: ExplicitProxyEndPoint.BeforeTunnelConnectResponse
- uid: Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.GenericCertificate
name: GenericCertificate
href: api/Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.html#Titanium_Web_Proxy_Models_ExplicitProxyEndPoint_GenericCertificate
commentId: P:Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.GenericCertificate
fullName: Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.GenericCertificate
nameWithType: ExplicitProxyEndPoint.GenericCertificate
- uid: Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.GenericCertificate*
name: GenericCertificate
href: api/Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.html#Titanium_Web_Proxy_Models_ExplicitProxyEndPoint_GenericCertificate_
commentId: Overload:Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.GenericCertificate
isSpec: "True"
fullName: Titanium.Web.Proxy.Models.ExplicitProxyEndPoint.GenericCertificate
nameWithType: ExplicitProxyEndPoint.GenericCertificate
- uid: Titanium.Web.Proxy.Models.ExternalProxy
name: ExternalProxy
href: api/Titanium.Web.Proxy.Models.ExternalProxy.html
......@@ -2833,6 +2820,19 @@ references:
isSpec: "True"
fullName: Titanium.Web.Proxy.Models.ProxyEndPoint.DecryptSsl
nameWithType: ProxyEndPoint.DecryptSsl
- uid: Titanium.Web.Proxy.Models.ProxyEndPoint.GenericCertificate
name: GenericCertificate
href: api/Titanium.Web.Proxy.Models.ProxyEndPoint.html#Titanium_Web_Proxy_Models_ProxyEndPoint_GenericCertificate
commentId: P:Titanium.Web.Proxy.Models.ProxyEndPoint.GenericCertificate
fullName: Titanium.Web.Proxy.Models.ProxyEndPoint.GenericCertificate
nameWithType: ProxyEndPoint.GenericCertificate
- uid: Titanium.Web.Proxy.Models.ProxyEndPoint.GenericCertificate*
name: GenericCertificate
href: api/Titanium.Web.Proxy.Models.ProxyEndPoint.html#Titanium_Web_Proxy_Models_ProxyEndPoint_GenericCertificate_
commentId: Overload:Titanium.Web.Proxy.Models.ProxyEndPoint.GenericCertificate
isSpec: "True"
fullName: Titanium.Web.Proxy.Models.ProxyEndPoint.GenericCertificate
nameWithType: ProxyEndPoint.GenericCertificate
- uid: Titanium.Web.Proxy.Models.ProxyEndPoint.IpAddress
name: IpAddress
href: api/Titanium.Web.Proxy.Models.ProxyEndPoint.html#Titanium_Web_Proxy_Models_ProxyEndPoint_IpAddress
......
......@@ -27,11 +27,6 @@ namespace Titanium.Web.Proxy.Models
internal bool IsSystemHttpsProxy { get; set; }
/// <summary>
/// Generic certificate to use for SSL decryption.
/// </summary>
public X509Certificate2 GenericCertificate { get; set; }
/// <summary>
/// Intercept tunnel connect request.
/// Valid only for explicit endpoints.
......
using System.Net;
using System.Net.Sockets;
using System.Security.Cryptography.X509Certificates;
namespace Titanium.Web.Proxy.Models
{
......@@ -47,5 +48,11 @@ namespace Titanium.Web.Proxy.Models
public bool IpV6Enabled => Equals(IpAddress, IPAddress.IPv6Any)
|| Equals(IpAddress, IPAddress.IPv6Loopback)
|| Equals(IpAddress, IPAddress.IPv6None);
/// <summary>
/// Generic certificate to use for SSL decryption.
/// </summary>
public X509Certificate2 GenericCertificate { get; set; }
}
}
......@@ -300,8 +300,6 @@ namespace Titanium.Web.Proxy
return false;
}
args.TimeLine["Connection Ready"] = DateTime.Now;
// construct the web request that we are going to issue on behalf of the client.
await handleHttpSessionRequest(connection, args);
return true;
......@@ -382,7 +380,6 @@ namespace Titanium.Web.Proxy
await handleHttpSessionResponse(args);
}
args.TimeLine["Response Sent"] = DateTime.Now;
}
/// <summary>
......
......@@ -130,6 +130,8 @@ namespace Titanium.Web.Proxy
}
}
args.TimeLine["Response Sent"] = DateTime.Now;
}
/// <summary>
......
......@@ -81,7 +81,8 @@ namespace Titanium.Web.Proxy
sslStream = new SslStream(clientStream);
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
await sslStream.AuthenticateAsServerAsync(certificate, false, SslProtocols.Tls, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment