Unverified Commit 3a62c35e authored by honfika's avatar honfika Committed by GitHub

Merge pull request #723 from justcoding121/master

stable
parents 3461257d 6db82ba8
......@@ -15,6 +15,7 @@ Kindly report only issues/bugs here. For programming help or questions use [Stac
* View/modify/redirect/block requests and responses
* Supports mutual SSL authentication, proxy authentication & automatic upstream proxy detection
* Kerberos/NTLM authentication over HTTP protocols for windows domain
* SOCKS4/5 Proxy support
### Installation
Install by [nuget](https://www.nuget.org/packages/Titanium.Web.Proxy)
......@@ -29,21 +30,21 @@ For stable releases on [stable branch](https://github.com/justcoding121/Titanium
Supports
* .Net Standard 2.0 or above
* .Net Framework 4.6.1 or above
* .NET Standard 2.0 or above
* .NET Framework 4.5 or above
### Development environment
#### Windows
* Visual Studio Code as IDE for .NET core
* Visual Studio 2017/2019 as IDE for .NET framework/.NET core
* Visual Studio Code as IDE for .NET Core
* Visual Studio 2019 as IDE for .NET Framework/.NET Core
#### Mac OS
* Visual Studio Code as IDE for .NET core
* Visual Studio 2017 as IDE for Mono
* Visual Studio Code as IDE for .NET Core
* Visual Studio 2019 as IDE for Mono
#### Linux
* Visual Studio Code as IDE for .NET core
* Visual Studio Code as IDE for .NET Core
* Mono develop as IDE for Mono
### Usage
......@@ -191,7 +192,7 @@ public async Task OnResponse(object sender, SessionEventArgs e)
{
if (e.HttpClient.Response.ResponseStatusCode == "200")
{
if (e.HttpClient.Response.ContentType!=null && e.HttpClient.Response.ContentType.Trim().ToLower().Contains("text/html"))
if (e.HttpClient.Response.ContentType != null && e.HttpClient.Response.ContentType.Trim().ToLower().Contains("text/html"))
{
byte[] bodyBytes = await e.GetResponseBody();
await e.SetResponseBody(bodyBytes);
......@@ -202,7 +203,7 @@ public async Task OnResponse(object sender, SessionEventArgs e)
}
}
if (e.UserData!=null)
if (e.UserData != null)
{
// access request from UserData property where we stored it in RequestHandler
var request = (Request)e.UserData;
......@@ -216,14 +217,14 @@ public Task OnCertificateValidation(object sender, CertificateValidationEventArg
if (e.SslPolicyErrors == System.Net.Security.SslPolicyErrors.None)
e.IsValid = true;
return Task.FromResult(0);
return Task.CompletedTask;
}
// Allows overriding default client certificate selection logic during mutual authentication
public Task OnCertificateSelection(object sender, CertificateSelectionEventArgs e)
{
// set e.clientCertificate to override
return Task.FromResult(0);
return Task.CompletedTask;
}
```
### Note to contributors
......
......@@ -155,6 +155,9 @@ or when server terminates connection from proxy.</p>
<div>
<a class="xref" href="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsTransparent">SessionEventArgsBase.IsTransparent</a>
</div>
<div>
<a class="xref" href="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsSocks">SessionEventArgsBase.IsSocks</a>
</div>
<div>
<a class="xref" href="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Exception">SessionEventArgsBase.Exception</a>
</div>
......
......@@ -390,7 +390,7 @@ public IPEndPoint ClientEndPoint { get; }</code></pre>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Exception.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.Exception%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/EventArguments/SessionEventArgsBase.cs/#L146">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L151">View Source</a>
</span>
<a id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Exception_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.Exception*"></a>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Exception" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.Exception">Exception</h4>
......@@ -478,6 +478,37 @@ public IPEndPoint ClientEndPoint { get; }</code></pre>
</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_EventArguments_SessionEventArgsBase_IsSocks.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsSocks%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/EventArguments/SessionEventArgsBase.cs/#L146">View Source</a>
</span>
<a id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsSocks_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsSocks*"></a>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsSocks" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsSocks">IsSocks</h4>
<div class="markdown level1 summary"><p>Is this a SOCKS endpoint?</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool IsSocks { get; }</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.boolean">Boolean</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_EventArguments_SessionEventArgsBase_IsTransparent.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsTransparent%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>
......@@ -702,7 +733,7 @@ public HttpWebClient WebSession { get; }</code></pre>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Dispose.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.Dispose%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/EventArguments/SessionEventArgsBase.cs/#L151">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L156">View Source</a>
</span>
<a id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Dispose_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.Dispose*"></a>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Dispose" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.Dispose">Dispose()</h4>
......@@ -718,7 +749,7 @@ public HttpWebClient WebSession { get; }</code></pre>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_TerminateSession.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.TerminateSession%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/EventArguments/SessionEventArgsBase.cs/#L199">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L204">View Source</a>
</span>
<a id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_TerminateSession_" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.TerminateSession*"></a>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_TerminateSession" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.TerminateSession">TerminateSession()</h4>
......@@ -736,7 +767,7 @@ public HttpWebClient WebSession { get; }</code></pre>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_DataReceived.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.DataReceived%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/EventArguments/SessionEventArgsBase.cs/#L170">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L175">View Source</a>
</span>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_DataReceived" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.DataReceived">DataReceived</h4>
<div class="markdown level1 summary"><p>Fired when data is received within this session from client/server.</p>
......@@ -766,7 +797,7 @@ public HttpWebClient WebSession { get; }</code></pre>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_DataSent.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.DataSent%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/EventArguments/SessionEventArgsBase.cs/#L165">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs/#L170">View Source</a>
</span>
<h4 id="Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_DataSent" data-uid="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.DataSent">DataSent</h4>
<div class="markdown level1 summary"><p>Fired when data is sent within this session to server/client.</p>
......
......@@ -152,6 +152,9 @@
<div>
<a class="xref" href="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsTransparent">SessionEventArgsBase.IsTransparent</a>
</div>
<div>
<a class="xref" href="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsSocks">SessionEventArgsBase.IsSocks</a>
</div>
<div>
<a class="xref" href="Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_Exception">SessionEventArgsBase.Exception</a>
</div>
......
......@@ -108,6 +108,10 @@
Default.</p>
</td>
</tr>
<tr>
<td id="Titanium_Web_Proxy_Network_CertificateEngine_BouncyCastleFast">BouncyCastleFast</td>
<td></td>
</tr>
<tr>
<td id="Titanium_Web_Proxy_Network_CertificateEngine_DefaultWindows">DefaultWindows</td>
<td><p>Uses Windows Certification Generation API and only valid in Windows OS.
......
......@@ -132,7 +132,7 @@
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_CertificateCacheTimeOutMinutes.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.CertificateCacheTimeOutMinutes%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/Network/CertificateManager.cs/#L257">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L269">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_CertificateCacheTimeOutMinutes_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CertificateCacheTimeOutMinutes*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_CertificateCacheTimeOutMinutes" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CertificateCacheTimeOutMinutes">CertificateCacheTimeOutMinutes</h4>
......@@ -163,7 +163,7 @@
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_CertificateEngine.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.CertificateEngine%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/Network/CertificateManager.cs/#L161">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L173">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_CertificateEngine_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CertificateEngine*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_CertificateEngine" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CertificateEngine">CertificateEngine</h4>
......@@ -196,7 +196,7 @@ Mono only support BouncyCastle and it is the default.</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_CertificateStorage.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage%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/Network/CertificateManager.cs/#L242">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L254">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_CertificateStorage_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_CertificateStorage" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage">CertificateStorage</h4>
......@@ -229,7 +229,7 @@ Implement ICertificateCache interface and assign concrete class here to customiz
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_OverwritePfxFile.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.OverwritePfxFile%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/Network/CertificateManager.cs/#L252">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L264">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_OverwritePfxFile_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.OverwritePfxFile*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_OverwritePfxFile" data-uid="Titanium.Web.Proxy.Network.CertificateManager.OverwritePfxFile">OverwritePfxFile</h4>
......@@ -261,7 +261,7 @@ Implement ICertificateCache interface and assign concrete class here to customiz
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_PfxFilePath.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.PfxFilePath%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/Network/CertificateManager.cs/#L193">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L205">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_PfxFilePath_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.PfxFilePath*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_PfxFilePath" data-uid="Titanium.Web.Proxy.Network.CertificateManager.PfxFilePath">PfxFilePath</h4>
......@@ -296,7 +296,7 @@ Implement ICertificateCache interface and assign concrete class here to customiz
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_PfxPassword.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.PfxPassword%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/Network/CertificateManager.cs/#L184">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L196">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_PfxPassword_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.PfxPassword*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_PfxPassword" data-uid="Titanium.Web.Proxy.Network.CertificateManager.PfxPassword">PfxPassword</h4>
......@@ -328,7 +328,7 @@ Implement ICertificateCache interface and assign concrete class here to customiz
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_RootCertificate.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.RootCertificate%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/Network/CertificateManager.cs/#L221">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L233">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_RootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RootCertificate*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_RootCertificate" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RootCertificate">RootCertificate</h4>
......@@ -359,7 +359,7 @@ Implement ICertificateCache interface and assign concrete class here to customiz
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_RootCertificateIssuerName.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.RootCertificateIssuerName%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/Network/CertificateManager.cs/#L199">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L211">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_RootCertificateIssuerName_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RootCertificateIssuerName*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_RootCertificateIssuerName" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RootCertificateIssuerName">RootCertificateIssuerName</h4>
......@@ -391,7 +391,7 @@ Implement ICertificateCache interface and assign concrete class here to customiz
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_RootCertificateName.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.RootCertificateName%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/Network/CertificateManager.cs/#L212">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L224">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_RootCertificateName_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RootCertificateName*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_RootCertificateName" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RootCertificateName">RootCertificateName</h4>
......@@ -426,7 +426,7 @@ Root certificate file will be named as &quot;rootCert.pfx&quot;.</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_SaveFakeCertificates.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.SaveFakeCertificates%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/Network/CertificateManager.cs/#L235">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L247">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_SaveFakeCertificates_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.SaveFakeCertificates*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_SaveFakeCertificates" data-uid="Titanium.Web.Proxy.Network.CertificateManager.SaveFakeCertificates">SaveFakeCertificates</h4>
......@@ -458,7 +458,7 @@ Root certificate file will be named as &quot;rootCert.pfx&quot;.</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_StorageFlag.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.StorageFlag%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/Network/CertificateManager.cs/#L262">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L274">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_StorageFlag_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.StorageFlag*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_StorageFlag" data-uid="Titanium.Web.Proxy.Network.CertificateManager.StorageFlag">StorageFlag</h4>
......@@ -491,7 +491,7 @@ Root certificate file will be named as &quot;rootCert.pfx&quot;.</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_ClearRootCertificate.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.ClearRootCertificate%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/Network/CertificateManager.cs/#L902">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L914">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_ClearRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.ClearRootCertificate*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_ClearRootCertificate" data-uid="Titanium.Web.Proxy.Network.CertificateManager.ClearRootCertificate">ClearRootCertificate()</h4>
......@@ -507,7 +507,7 @@ Root certificate file will be named as &quot;rootCert.pfx&quot;.</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_CreateRootCertificate_System_Boolean_.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.CreateRootCertificate(System.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/Network/CertificateManager.cs/#L537">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L549">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_CreateRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CreateRootCertificate*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_CreateRootCertificate_System_Boolean_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CreateRootCertificate(System.Boolean)">CreateRootCertificate(Boolean)</h4>
......@@ -557,7 +557,7 @@ Root certificate file will be named as &quot;rootCert.pfx&quot;.</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_CreateServerCertificate_System_String_.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.CreateServerCertificate(System.String)%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/Network/CertificateManager.cs/#L457">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L469">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_CreateServerCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CreateServerCertificate*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_CreateServerCertificate_System_String_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CreateServerCertificate(System.String)">CreateServerCertificate(String)</h4>
......@@ -605,7 +605,7 @@ Root certificate file will be named as &quot;rootCert.pfx&quot;.</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_Dispose.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.Dispose%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/Network/CertificateManager.cs/#L267">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L279">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_Dispose_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.Dispose*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_Dispose" data-uid="Titanium.Web.Proxy.Network.CertificateManager.Dispose">Dispose()</h4>
......@@ -621,7 +621,7 @@ Root certificate file will be named as &quot;rootCert.pfx&quot;.</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_EnsureRootCertificate.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate%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/Network/CertificateManager.cs/#L735">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L747">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_EnsureRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_EnsureRootCertificate" data-uid="Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate">EnsureRootCertificate()</h4>
......@@ -638,7 +638,7 @@ Also makes root certificate trusted based on initial setup from proxy constructo
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_EnsureRootCertificate_System_Boolean_System_Boolean_System_Boolean_.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate(System.Boolean%2CSystem.Boolean%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/Network/CertificateManager.cs/#L766">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L778">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_EnsureRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_EnsureRootCertificate_System_Boolean_System_Boolean_System_Boolean_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate(System.Boolean,System.Boolean,System.Boolean)">EnsureRootCertificate(Boolean, Boolean, Boolean)</h4>
......@@ -688,7 +688,7 @@ prompting for UAC if required?</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_IsRootCertificateMachineTrusted.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateMachineTrusted%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/Network/CertificateManager.cs/#L787">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L799">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_IsRootCertificateMachineTrusted_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateMachineTrusted*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_IsRootCertificateMachineTrusted" data-uid="Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateMachineTrusted">IsRootCertificateMachineTrusted()</h4>
......@@ -719,7 +719,7 @@ prompting for UAC if required?</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_IsRootCertificateUserTrusted.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateUserTrusted%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/Network/CertificateManager.cs/#L779">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L791">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_IsRootCertificateUserTrusted_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateUserTrusted*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_IsRootCertificateUserTrusted" data-uid="Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateUserTrusted">IsRootCertificateUserTrusted()</h4>
......@@ -750,7 +750,7 @@ prompting for UAC if required?</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_LoadRootCertificate.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate%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/Network/CertificateManager.cs/#L607">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L619">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_LoadRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_LoadRootCertificate" data-uid="Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate">LoadRootCertificate()</h4>
......@@ -781,7 +781,7 @@ prompting for UAC if required?</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_LoadRootCertificate_System_String_System_String_System_Boolean_System_Security_Cryptography_X509Certificates_X509KeyStorageFlags_.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate(System.String%2CSystem.String%2CSystem.Boolean%2CSystem.Security.Cryptography.X509Certificates.X509KeyStorageFlags)%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/Network/CertificateManager.cs/#L636">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L648">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_LoadRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_LoadRootCertificate_System_String_System_String_System_Boolean_System_Security_Cryptography_X509Certificates_X509KeyStorageFlags_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate(System.String,System.String,System.Boolean,System.Security.Cryptography.X509Certificates.X509KeyStorageFlags)">LoadRootCertificate(String, String, Boolean, X509KeyStorageFlags)</h4>
......@@ -850,7 +850,7 @@ RootCertificate==null.</p>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_RemoveTrustedRootCertificate_System_Boolean_.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificate(System.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/Network/CertificateManager.cs/#L797">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L809">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_RemoveTrustedRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificate*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_RemoveTrustedRootCertificate_System_Boolean_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificate(System.Boolean)">RemoveTrustedRootCertificate(Boolean)</h4>
......@@ -885,7 +885,7 @@ To remove from machine store elevated permissions are required (will fail silent
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_RemoveTrustedRootCertificateAsAdmin_System_Boolean_.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificateAsAdmin(System.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/Network/CertificateManager.cs/#L821">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L833">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_RemoveTrustedRootCertificateAsAdmin_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificateAsAdmin*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_RemoveTrustedRootCertificateAsAdmin_System_Boolean_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificateAsAdmin(System.Boolean)">RemoveTrustedRootCertificateAsAdmin(Boolean)</h4>
......@@ -934,7 +934,7 @@ To remove from machine store elevated permissions are required (will fail silent
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_TrustRootCertificate_System_Boolean_.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificate(System.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/Network/CertificateManager.cs/#L653">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L665">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_TrustRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificate*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_TrustRootCertificate_System_Boolean_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificate(System.Boolean)">TrustRootCertificate(Boolean)</h4>
......@@ -968,7 +968,7 @@ Machine trust would require elevated permissions (will silently fail otherwise).
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager_TrustRootCertificateAsAdmin_System_Boolean_.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificateAsAdmin(System.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/Network/CertificateManager.cs/#L678">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L690">View Source</a>
</span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_TrustRootCertificateAsAdmin_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificateAsAdmin*"></a>
<h4 id="Titanium_Web_Proxy_Network_CertificateManager_TrustRootCertificateAsAdmin_System_Boolean_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificateAsAdmin(System.Boolean)">TrustRootCertificateAsAdmin(Boolean)</h4>
......@@ -1028,7 +1028,7 @@ Prompts with UAC if elevated permissions are required. Works only on Windows.</p
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/new/master/apiSpec/new?filename=Titanium_Web_Proxy_Network_CertificateManager.md&amp;value=---%0Auid%3A%20Titanium.Web.Proxy.Network.CertificateManager%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/Network/CertificateManager.cs/#L38" class="contribution-link">View Source</a>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L40" class="contribution-link">View Source</a>
</li>
</ul>
</div>
......
......@@ -32,17 +32,17 @@
"api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html": {
"href": "api/Titanium.Web.Proxy.EventArguments.SessionEventArgs.html",
"title": "Class SessionEventArgs | Titanium Web Proxy",
"keywords": "Class SessionEventArgs Holds info related to a single proxy session (single request/response sequence). A proxy session is bounded to a single connection from client. A proxy session ends when client terminates connection to proxy or when server terminates connection from proxy. Inheritance Object SessionEventArgsBase SessionEventArgs Implements IDisposable Inherited Members SessionEventArgsBase.ClientConnectionId SessionEventArgsBase.ServerConnectionId SessionEventArgsBase.BufferPool SessionEventArgsBase.ExceptionFunc SessionEventArgsBase.TimeLine SessionEventArgsBase.UserData SessionEventArgsBase.EnableWinAuth SessionEventArgsBase.IsHttps SessionEventArgsBase.ClientLocalEndPoint SessionEventArgsBase.ClientRemoteEndPoint SessionEventArgsBase.ClientEndPoint SessionEventArgsBase.HttpClient SessionEventArgsBase.WebSession SessionEventArgsBase.CustomUpStreamProxy SessionEventArgsBase.CustomUpStreamProxyUsed SessionEventArgsBase.ProxyEndPoint SessionEventArgsBase.LocalEndPoint SessionEventArgsBase.IsTransparent SessionEventArgsBase.Exception SessionEventArgsBase.DataSent SessionEventArgsBase.DataReceived SessionEventArgsBase.TerminateSession() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class SessionEventArgs : SessionEventArgsBase, IDisposable Properties | Improve this Doc View Source IsPromise Is this session a HTTP/2 promise? Declaration public bool IsPromise { get; } Property Value Type Description Boolean | Improve this Doc View Source ReRequest Should we send the request again ? Declaration public bool ReRequest { get; set; } Property Value Type Description Boolean | Improve this Doc View Source WebSocketDecoder Declaration public WebSocketDecoder WebSocketDecoder { get; } Property Value Type Description WebSocketDecoder Methods | Improve this Doc View Source Dispose() Implement any cleanup here Declaration public override void Dispose() Overrides SessionEventArgsBase.Dispose() | Improve this Doc View Source GenericResponse(Byte[], HttpStatusCode, Dictionary<String, HttpHeader>, Boolean) Before request is made to server respond with the specified byte[], the specified status to client. And then ignore the request. Declaration public void GenericResponse(byte[] result, HttpStatusCode status, Dictionary<string, HttpHeader> headers, bool closeServerConnection = false) Parameters Type Name Description Byte [] result The bytes to sent. HttpStatusCode status The HTTP status code. Dictionary < String , HttpHeader > headers The HTTP headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source GenericResponse(String, HttpStatusCode, Dictionary<String, HttpHeader>, Boolean) Before request is made to server respond with the specified HTML string and the specified status to client. And then ignore the request. Declaration public void GenericResponse(string html, HttpStatusCode status, Dictionary<string, HttpHeader> headers = null, bool closeServerConnection = false) Parameters Type Name Description String html The html content. HttpStatusCode status The HTTP status code. Dictionary < String , HttpHeader > headers The HTTP headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source GetRequestBody(CancellationToken) Gets the request body as bytes. Declaration public Task<byte[]> GetRequestBody(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < Byte []> The body as bytes. | Improve this Doc View Source GetRequestBodyAsString(CancellationToken) Gets the request body as string. Declaration public Task<string> GetRequestBodyAsString(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < String > The body as string. | Improve this Doc View Source GetResponseBody(CancellationToken) Gets the response body as bytes. Declaration public Task<byte[]> GetResponseBody(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < Byte []> The resulting bytes. | Improve this Doc View Source GetResponseBodyAsString(CancellationToken) Gets the response body as string. Declaration public Task<string> GetResponseBodyAsString(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < String > The string body. | Improve this Doc View Source Ok(Byte[], Dictionary<String, HttpHeader>, Boolean) Before request is made to server respond with the specified byte[] to client and ignore the request. Declaration public void Ok(byte[] result, Dictionary<string, HttpHeader> headers = null, bool closeServerConnection = false) Parameters Type Name Description Byte [] result The html content bytes. Dictionary < String , HttpHeader > headers The HTTP headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source Ok(String, Dictionary<String, HttpHeader>, Boolean) Before request is made to server respond with the specified HTML string to client and ignore the request. Declaration public void Ok(string html, Dictionary<string, HttpHeader> headers = null, bool closeServerConnection = false) Parameters Type Name Description String html HTML content to sent. Dictionary < String , HttpHeader > headers HTTP response headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source Redirect(String, Boolean) Redirect to provided URL. Declaration public void Redirect(string url, bool closeServerConnection = false) Parameters Type Name Description String url The URL to redirect. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source Respond(Response, Boolean) Respond with given response object to client. Declaration public void Respond(Response response, bool closeServerConnection = false) Parameters Type Name Description Response response The response object. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source SetRequestBody(Byte[]) Sets the request body. Declaration public void SetRequestBody(byte[] body) Parameters Type Name Description Byte [] body The request body bytes. | Improve this Doc View Source SetRequestBodyString(String) Sets the body with the specified string. Declaration public void SetRequestBodyString(string body) Parameters Type Name Description String body The request body string to set. | Improve this Doc View Source SetResponseBody(Byte[]) Set the response body bytes. Declaration public void SetResponseBody(byte[] body) Parameters Type Name Description Byte [] body The body bytes to set. | Improve this Doc View Source SetResponseBodyString(String) Replace the response body with the specified string. Declaration public void SetResponseBodyString(string body) Parameters Type Name Description String body The body string to set. | Improve this Doc View Source TerminateServerConnection() Terminate the connection to server at the end of this HTTP request/response session. Declaration public void TerminateServerConnection() Events | Improve this Doc View Source MultipartRequestPartSent Occurs when multipart request part sent. Declaration public event EventHandler<MultipartRequestPartSentEventArgs> MultipartRequestPartSent Event Type Type Description EventHandler < MultipartRequestPartSentEventArgs > Implements System.IDisposable"
"keywords": "Class SessionEventArgs Holds info related to a single proxy session (single request/response sequence). A proxy session is bounded to a single connection from client. A proxy session ends when client terminates connection to proxy or when server terminates connection from proxy. Inheritance Object SessionEventArgsBase SessionEventArgs Implements IDisposable Inherited Members SessionEventArgsBase.ClientConnectionId SessionEventArgsBase.ServerConnectionId SessionEventArgsBase.BufferPool SessionEventArgsBase.ExceptionFunc SessionEventArgsBase.TimeLine SessionEventArgsBase.UserData SessionEventArgsBase.EnableWinAuth SessionEventArgsBase.IsHttps SessionEventArgsBase.ClientLocalEndPoint SessionEventArgsBase.ClientRemoteEndPoint SessionEventArgsBase.ClientEndPoint SessionEventArgsBase.HttpClient SessionEventArgsBase.WebSession SessionEventArgsBase.CustomUpStreamProxy SessionEventArgsBase.CustomUpStreamProxyUsed SessionEventArgsBase.ProxyEndPoint SessionEventArgsBase.LocalEndPoint SessionEventArgsBase.IsTransparent SessionEventArgsBase.IsSocks SessionEventArgsBase.Exception SessionEventArgsBase.DataSent SessionEventArgsBase.DataReceived SessionEventArgsBase.TerminateSession() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class SessionEventArgs : SessionEventArgsBase, IDisposable Properties | Improve this Doc View Source IsPromise Is this session a HTTP/2 promise? Declaration public bool IsPromise { get; } Property Value Type Description Boolean | Improve this Doc View Source ReRequest Should we send the request again ? Declaration public bool ReRequest { get; set; } Property Value Type Description Boolean | Improve this Doc View Source WebSocketDecoder Declaration public WebSocketDecoder WebSocketDecoder { get; } Property Value Type Description WebSocketDecoder Methods | Improve this Doc View Source Dispose() Implement any cleanup here Declaration public override void Dispose() Overrides SessionEventArgsBase.Dispose() | Improve this Doc View Source GenericResponse(Byte[], HttpStatusCode, Dictionary<String, HttpHeader>, Boolean) Before request is made to server respond with the specified byte[], the specified status to client. And then ignore the request. Declaration public void GenericResponse(byte[] result, HttpStatusCode status, Dictionary<string, HttpHeader> headers, bool closeServerConnection = false) Parameters Type Name Description Byte [] result The bytes to sent. HttpStatusCode status The HTTP status code. Dictionary < String , HttpHeader > headers The HTTP headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source GenericResponse(String, HttpStatusCode, Dictionary<String, HttpHeader>, Boolean) Before request is made to server respond with the specified HTML string and the specified status to client. And then ignore the request. Declaration public void GenericResponse(string html, HttpStatusCode status, Dictionary<string, HttpHeader> headers = null, bool closeServerConnection = false) Parameters Type Name Description String html The html content. HttpStatusCode status The HTTP status code. Dictionary < String , HttpHeader > headers The HTTP headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source GetRequestBody(CancellationToken) Gets the request body as bytes. Declaration public Task<byte[]> GetRequestBody(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < Byte []> The body as bytes. | Improve this Doc View Source GetRequestBodyAsString(CancellationToken) Gets the request body as string. Declaration public Task<string> GetRequestBodyAsString(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < String > The body as string. | Improve this Doc View Source GetResponseBody(CancellationToken) Gets the response body as bytes. Declaration public Task<byte[]> GetResponseBody(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < Byte []> The resulting bytes. | Improve this Doc View Source GetResponseBodyAsString(CancellationToken) Gets the response body as string. Declaration public Task<string> GetResponseBodyAsString(CancellationToken cancellationToken = default(CancellationToken)) Parameters Type Name Description CancellationToken cancellationToken Optional cancellation token for this async task. Returns Type Description Task < String > The string body. | Improve this Doc View Source Ok(Byte[], Dictionary<String, HttpHeader>, Boolean) Before request is made to server respond with the specified byte[] to client and ignore the request. Declaration public void Ok(byte[] result, Dictionary<string, HttpHeader> headers = null, bool closeServerConnection = false) Parameters Type Name Description Byte [] result The html content bytes. Dictionary < String , HttpHeader > headers The HTTP headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source Ok(String, Dictionary<String, HttpHeader>, Boolean) Before request is made to server respond with the specified HTML string to client and ignore the request. Declaration public void Ok(string html, Dictionary<string, HttpHeader> headers = null, bool closeServerConnection = false) Parameters Type Name Description String html HTML content to sent. Dictionary < String , HttpHeader > headers HTTP response headers. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source Redirect(String, Boolean) Redirect to provided URL. Declaration public void Redirect(string url, bool closeServerConnection = false) Parameters Type Name Description String url The URL to redirect. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source Respond(Response, Boolean) Respond with given response object to client. Declaration public void Respond(Response response, bool closeServerConnection = false) Parameters Type Name Description Response response The response object. Boolean closeServerConnection Close the server connection used by request if any? | Improve this Doc View Source SetRequestBody(Byte[]) Sets the request body. Declaration public void SetRequestBody(byte[] body) Parameters Type Name Description Byte [] body The request body bytes. | Improve this Doc View Source SetRequestBodyString(String) Sets the body with the specified string. Declaration public void SetRequestBodyString(string body) Parameters Type Name Description String body The request body string to set. | Improve this Doc View Source SetResponseBody(Byte[]) Set the response body bytes. Declaration public void SetResponseBody(byte[] body) Parameters Type Name Description Byte [] body The body bytes to set. | Improve this Doc View Source SetResponseBodyString(String) Replace the response body with the specified string. Declaration public void SetResponseBodyString(string body) Parameters Type Name Description String body The body string to set. | Improve this Doc View Source TerminateServerConnection() Terminate the connection to server at the end of this HTTP request/response session. Declaration public void TerminateServerConnection() Events | Improve this Doc View Source MultipartRequestPartSent Occurs when multipart request part sent. Declaration public event EventHandler<MultipartRequestPartSentEventArgs> MultipartRequestPartSent Event Type Type Description EventHandler < MultipartRequestPartSentEventArgs > Implements System.IDisposable"
},
"api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html": {
"href": "api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html",
"title": "Class SessionEventArgsBase | Titanium Web Proxy",
"keywords": "Class SessionEventArgsBase Holds info related to a single proxy session (single request/response sequence). A proxy session is bounded to a single connection from client. A proxy session ends when client terminates connection to proxy or when server terminates connection from proxy. Inheritance Object SessionEventArgsBase SessionEventArgs TunnelConnectSessionEventArgs Implements IDisposable Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public abstract class SessionEventArgsBase : ProxyEventArgsBase, IDisposable Fields | Improve this Doc View Source BufferPool Declaration protected readonly IBufferPool BufferPool Field Value Type Description IBufferPool | Improve this Doc View Source ExceptionFunc Declaration protected readonly ExceptionHandler ExceptionFunc Field Value Type Description ExceptionHandler Properties | Improve this Doc View Source ClientConnectionId Declaration public Guid ClientConnectionId { get; } Property Value Type Description Guid | Improve this Doc View Source ClientEndPoint Declaration [Obsolete(\"Use ClientRemoteEndPoint instead.\")] public IPEndPoint ClientEndPoint { get; } Property Value Type Description IPEndPoint | Improve this Doc View Source ClientLocalEndPoint Client Local End Point. Declaration public IPEndPoint ClientLocalEndPoint { get; } Property Value Type Description IPEndPoint | Improve this Doc View Source ClientRemoteEndPoint Client Remote End Point. Declaration public IPEndPoint ClientRemoteEndPoint { get; } Property Value Type Description IPEndPoint | Improve this Doc View Source CustomUpStreamProxy Gets or sets the custom up stream proxy. Declaration public IExternalProxy? CustomUpStreamProxy { get; set; } Property Value Type Description Nullable < IExternalProxy > The custom up stream proxy. | Improve this Doc View Source CustomUpStreamProxyUsed Are we using a custom upstream HTTP(S) proxy? Declaration public IExternalProxy? CustomUpStreamProxyUsed { get; } Property Value Type Description Nullable < IExternalProxy > | Improve this Doc View Source EnableWinAuth Enable/disable Windows Authentication (NTLM/Kerberos) for the current session. Declaration public bool EnableWinAuth { get; set; } Property Value Type Description Boolean | Improve this Doc View Source Exception The last exception that happened. Declaration public Exception Exception { get; } Property Value Type Description Exception | Improve this Doc View Source HttpClient The web client used to communicate with server for this session. Declaration public HttpWebClient HttpClient { get; } Property Value Type Description HttpWebClient | Improve this Doc View Source IsHttps Does this session uses SSL? Declaration public bool IsHttps { get; } Property Value Type Description Boolean | Improve this Doc View Source IsTransparent Is this a transparent endpoint? Declaration public bool IsTransparent { get; } Property Value Type Description Boolean | Improve this Doc View Source LocalEndPoint Declaration [Obsolete(\"Use ProxyEndPoint instead.\")] public ProxyEndPoint LocalEndPoint { get; } Property Value Type Description ProxyEndPoint | Improve this Doc View Source ProxyEndPoint Local endpoint via which we make the request. Declaration public ProxyEndPoint ProxyEndPoint { get; } Property Value Type Description ProxyEndPoint | Improve this Doc View Source ServerConnectionId Declaration public Guid ServerConnectionId { get; } Property Value Type Description Guid | Improve this Doc View Source TimeLine Relative milliseconds for various events. Declaration public Dictionary<string, DateTime> TimeLine { get; } Property Value Type Description Dictionary < String , DateTime > | Improve this Doc View Source UserData Returns a user data for this request/response session which is same as the user data of HttpClient. Declaration public object UserData { get; set; } Property Value Type Description Object | Improve this Doc View Source WebSession Declaration [Obsolete(\"Use HttpClient instead.\")] public HttpWebClient WebSession { get; } Property Value Type Description HttpWebClient Methods | Improve this Doc View Source Dispose() Implements cleanup here. Declaration public virtual void Dispose() | Improve this Doc View Source TerminateSession() Terminates the session abruptly by terminating client/server connections. Declaration public void TerminateSession() Events | Improve this Doc View Source DataReceived Fired when data is received within this session from client/server. Declaration public event EventHandler<DataEventArgs> DataReceived Event Type Type Description EventHandler < DataEventArgs > | Improve this Doc View Source DataSent Fired when data is sent within this session to server/client. Declaration public event EventHandler<DataEventArgs> DataSent Event Type Type Description EventHandler < DataEventArgs > Implements System.IDisposable"
"keywords": "Class SessionEventArgsBase Holds info related to a single proxy session (single request/response sequence). A proxy session is bounded to a single connection from client. A proxy session ends when client terminates connection to proxy or when server terminates connection from proxy. Inheritance Object SessionEventArgsBase SessionEventArgs TunnelConnectSessionEventArgs Implements IDisposable Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public abstract class SessionEventArgsBase : ProxyEventArgsBase, IDisposable Fields | Improve this Doc View Source BufferPool Declaration protected readonly IBufferPool BufferPool Field Value Type Description IBufferPool | Improve this Doc View Source ExceptionFunc Declaration protected readonly ExceptionHandler ExceptionFunc Field Value Type Description ExceptionHandler Properties | Improve this Doc View Source ClientConnectionId Declaration public Guid ClientConnectionId { get; } Property Value Type Description Guid | Improve this Doc View Source ClientEndPoint Declaration [Obsolete(\"Use ClientRemoteEndPoint instead.\")] public IPEndPoint ClientEndPoint { get; } Property Value Type Description IPEndPoint | Improve this Doc View Source ClientLocalEndPoint Client Local End Point. Declaration public IPEndPoint ClientLocalEndPoint { get; } Property Value Type Description IPEndPoint | Improve this Doc View Source ClientRemoteEndPoint Client Remote End Point. Declaration public IPEndPoint ClientRemoteEndPoint { get; } Property Value Type Description IPEndPoint | Improve this Doc View Source CustomUpStreamProxy Gets or sets the custom up stream proxy. Declaration public IExternalProxy? CustomUpStreamProxy { get; set; } Property Value Type Description Nullable < IExternalProxy > The custom up stream proxy. | Improve this Doc View Source CustomUpStreamProxyUsed Are we using a custom upstream HTTP(S) proxy? Declaration public IExternalProxy? CustomUpStreamProxyUsed { get; } Property Value Type Description Nullable < IExternalProxy > | Improve this Doc View Source EnableWinAuth Enable/disable Windows Authentication (NTLM/Kerberos) for the current session. Declaration public bool EnableWinAuth { get; set; } Property Value Type Description Boolean | Improve this Doc View Source Exception The last exception that happened. Declaration public Exception Exception { get; } Property Value Type Description Exception | Improve this Doc View Source HttpClient The web client used to communicate with server for this session. Declaration public HttpWebClient HttpClient { get; } Property Value Type Description HttpWebClient | Improve this Doc View Source IsHttps Does this session uses SSL? Declaration public bool IsHttps { get; } Property Value Type Description Boolean | Improve this Doc View Source IsSocks Is this a SOCKS endpoint? Declaration public bool IsSocks { get; } Property Value Type Description Boolean | Improve this Doc View Source IsTransparent Is this a transparent endpoint? Declaration public bool IsTransparent { get; } Property Value Type Description Boolean | Improve this Doc View Source LocalEndPoint Declaration [Obsolete(\"Use ProxyEndPoint instead.\")] public ProxyEndPoint LocalEndPoint { get; } Property Value Type Description ProxyEndPoint | Improve this Doc View Source ProxyEndPoint Local endpoint via which we make the request. Declaration public ProxyEndPoint ProxyEndPoint { get; } Property Value Type Description ProxyEndPoint | Improve this Doc View Source ServerConnectionId Declaration public Guid ServerConnectionId { get; } Property Value Type Description Guid | Improve this Doc View Source TimeLine Relative milliseconds for various events. Declaration public Dictionary<string, DateTime> TimeLine { get; } Property Value Type Description Dictionary < String , DateTime > | Improve this Doc View Source UserData Returns a user data for this request/response session which is same as the user data of HttpClient. Declaration public object UserData { get; set; } Property Value Type Description Object | Improve this Doc View Source WebSession Declaration [Obsolete(\"Use HttpClient instead.\")] public HttpWebClient WebSession { get; } Property Value Type Description HttpWebClient Methods | Improve this Doc View Source Dispose() Implements cleanup here. Declaration public virtual void Dispose() | Improve this Doc View Source TerminateSession() Terminates the session abruptly by terminating client/server connections. Declaration public void TerminateSession() Events | Improve this Doc View Source DataReceived Fired when data is received within this session from client/server. Declaration public event EventHandler<DataEventArgs> DataReceived Event Type Type Description EventHandler < DataEventArgs > | Improve this Doc View Source DataSent Fired when data is sent within this session to server/client. Declaration public event EventHandler<DataEventArgs> DataSent Event Type Type Description EventHandler < DataEventArgs > Implements System.IDisposable"
},
"api/Titanium.Web.Proxy.EventArguments.TunnelConnectSessionEventArgs.html": {
"href": "api/Titanium.Web.Proxy.EventArguments.TunnelConnectSessionEventArgs.html",
"title": "Class TunnelConnectSessionEventArgs | Titanium Web Proxy",
"keywords": "Class TunnelConnectSessionEventArgs A class that wraps the state when a tunnel connect event happen for Explicit endpoints. Inheritance Object SessionEventArgsBase TunnelConnectSessionEventArgs Implements IDisposable Inherited Members SessionEventArgsBase.ClientConnectionId SessionEventArgsBase.ServerConnectionId SessionEventArgsBase.BufferPool SessionEventArgsBase.ExceptionFunc SessionEventArgsBase.TimeLine SessionEventArgsBase.UserData SessionEventArgsBase.EnableWinAuth SessionEventArgsBase.IsHttps SessionEventArgsBase.ClientLocalEndPoint SessionEventArgsBase.ClientRemoteEndPoint SessionEventArgsBase.ClientEndPoint SessionEventArgsBase.HttpClient SessionEventArgsBase.WebSession SessionEventArgsBase.CustomUpStreamProxy SessionEventArgsBase.CustomUpStreamProxyUsed SessionEventArgsBase.ProxyEndPoint SessionEventArgsBase.LocalEndPoint SessionEventArgsBase.IsTransparent SessionEventArgsBase.Exception SessionEventArgsBase.Dispose() SessionEventArgsBase.DataSent SessionEventArgsBase.DataReceived SessionEventArgsBase.TerminateSession() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class TunnelConnectSessionEventArgs : SessionEventArgsBase, IDisposable Properties | Improve this Doc View Source DecryptSsl Should we decrypt the Ssl or relay it to server? Default is true. Declaration public bool DecryptSsl { get; set; } Property Value Type Description Boolean | Improve this Doc View Source DenyConnect When set to true it denies the connect request with a Forbidden status. Declaration public bool DenyConnect { get; set; } Property Value Type Description Boolean | Improve this Doc View Source IsHttpsConnect Is this a connect request to secure HTTP server? Or is it to some other protocol. Declaration public bool IsHttpsConnect { get; } Property Value Type Description Boolean Events | Improve this Doc View Source DecryptedDataReceived Fired when decrypted data is received within this session from client/server. Declaration public event EventHandler<DataEventArgs> DecryptedDataReceived Event Type Type Description EventHandler < DataEventArgs > | Improve this Doc View Source DecryptedDataSent Fired when decrypted data is sent within this session to server/client. Declaration public event EventHandler<DataEventArgs> DecryptedDataSent Event Type Type Description EventHandler < DataEventArgs > Implements System.IDisposable"
"keywords": "Class TunnelConnectSessionEventArgs A class that wraps the state when a tunnel connect event happen for Explicit endpoints. Inheritance Object SessionEventArgsBase TunnelConnectSessionEventArgs Implements IDisposable Inherited Members SessionEventArgsBase.ClientConnectionId SessionEventArgsBase.ServerConnectionId SessionEventArgsBase.BufferPool SessionEventArgsBase.ExceptionFunc SessionEventArgsBase.TimeLine SessionEventArgsBase.UserData SessionEventArgsBase.EnableWinAuth SessionEventArgsBase.IsHttps SessionEventArgsBase.ClientLocalEndPoint SessionEventArgsBase.ClientRemoteEndPoint SessionEventArgsBase.ClientEndPoint SessionEventArgsBase.HttpClient SessionEventArgsBase.WebSession SessionEventArgsBase.CustomUpStreamProxy SessionEventArgsBase.CustomUpStreamProxyUsed SessionEventArgsBase.ProxyEndPoint SessionEventArgsBase.LocalEndPoint SessionEventArgsBase.IsTransparent SessionEventArgsBase.IsSocks SessionEventArgsBase.Exception SessionEventArgsBase.Dispose() SessionEventArgsBase.DataSent SessionEventArgsBase.DataReceived SessionEventArgsBase.TerminateSession() Namespace : Titanium.Web.Proxy.EventArguments Assembly : Titanium.Web.Proxy.dll Syntax public class TunnelConnectSessionEventArgs : SessionEventArgsBase, IDisposable Properties | Improve this Doc View Source DecryptSsl Should we decrypt the Ssl or relay it to server? Default is true. Declaration public bool DecryptSsl { get; set; } Property Value Type Description Boolean | Improve this Doc View Source DenyConnect When set to true it denies the connect request with a Forbidden status. Declaration public bool DenyConnect { get; set; } Property Value Type Description Boolean | Improve this Doc View Source IsHttpsConnect Is this a connect request to secure HTTP server? Or is it to some other protocol. Declaration public bool IsHttpsConnect { get; } Property Value Type Description Boolean Events | Improve this Doc View Source DecryptedDataReceived Fired when decrypted data is received within this session from client/server. Declaration public event EventHandler<DataEventArgs> DecryptedDataReceived Event Type Type Description EventHandler < DataEventArgs > | Improve this Doc View Source DecryptedDataSent Fired when decrypted data is sent within this session to server/client. Declaration public event EventHandler<DataEventArgs> DecryptedDataSent Event Type Type Description EventHandler < DataEventArgs > Implements System.IDisposable"
},
"api/Titanium.Web.Proxy.ExceptionHandler.html": {
"href": "api/Titanium.Web.Proxy.ExceptionHandler.html",
......@@ -242,7 +242,7 @@
"api/Titanium.Web.Proxy.Network.CertificateEngine.html": {
"href": "api/Titanium.Web.Proxy.Network.CertificateEngine.html",
"title": "Enum CertificateEngine | Titanium Web Proxy",
"keywords": "Enum CertificateEngine Certificate Engine option. Namespace : Titanium.Web.Proxy.Network Assembly : Titanium.Web.Proxy.dll Syntax public enum CertificateEngine Fields Name Description BouncyCastle Uses BouncyCastle 3rd party library. Default. DefaultWindows Uses Windows Certification Generation API and only valid in Windows OS. Observed to be faster than BouncyCastle. Bug #468 Reported."
"keywords": "Enum CertificateEngine Certificate Engine option. Namespace : Titanium.Web.Proxy.Network Assembly : Titanium.Web.Proxy.dll Syntax public enum CertificateEngine Fields Name Description BouncyCastle Uses BouncyCastle 3rd party library. Default. BouncyCastleFast DefaultWindows Uses Windows Certification Generation API and only valid in Windows OS. Observed to be faster than BouncyCastle. Bug #468 Reported."
},
"api/Titanium.Web.Proxy.Network.CertificateManager.html": {
"href": "api/Titanium.Web.Proxy.Network.CertificateManager.html",
......
......@@ -732,6 +732,19 @@ references:
isSpec: "True"
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsHttps
nameWithType: SessionEventArgsBase.IsHttps
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsSocks
name: IsSocks
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsSocks
commentId: P:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsSocks
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsSocks
nameWithType: SessionEventArgsBase.IsSocks
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsSocks*
name: IsSocks
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsSocks_
commentId: Overload:Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsSocks
isSpec: "True"
fullName: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsSocks
nameWithType: SessionEventArgsBase.IsSocks
- uid: Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.IsTransparent
name: IsTransparent
href: api/Titanium.Web.Proxy.EventArguments.SessionEventArgsBase.html#Titanium_Web_Proxy_EventArguments_SessionEventArgsBase_IsTransparent
......@@ -2900,6 +2913,12 @@ references:
commentId: F:Titanium.Web.Proxy.Network.CertificateEngine.BouncyCastle
fullName: Titanium.Web.Proxy.Network.CertificateEngine.BouncyCastle
nameWithType: CertificateEngine.BouncyCastle
- uid: Titanium.Web.Proxy.Network.CertificateEngine.BouncyCastleFast
name: BouncyCastleFast
href: api/Titanium.Web.Proxy.Network.CertificateEngine.html#Titanium_Web_Proxy_Network_CertificateEngine_BouncyCastleFast
commentId: F:Titanium.Web.Proxy.Network.CertificateEngine.BouncyCastleFast
fullName: Titanium.Web.Proxy.Network.CertificateEngine.BouncyCastleFast
nameWithType: CertificateEngine.BouncyCastleFast
- uid: Titanium.Web.Proxy.Network.CertificateEngine.DefaultWindows
name: DefaultWindows
href: api/Titanium.Web.Proxy.Network.CertificateEngine.html#Titanium_Web_Proxy_Network_CertificateEngine_DefaultWindows
......
......@@ -44,6 +44,10 @@ namespace Titanium.Web.Proxy.Examples.Basic
};
proxyServer.ForwardToUpstreamGateway = true;
proxyServer.CertificateManager.SaveFakeCertificates = true;
//proxyServer.ProxyBasicAuthenticateFunc = async (args, userName, password) =>
//{
// return true;
//};
// this is just to show the functionality, provided implementations use junk value
//proxyServer.GetCustomUpStreamProxyFunc = onGetCustomUpStreamProxyFunc;
......@@ -94,8 +98,11 @@ namespace Titanium.Web.Proxy.Examples.Basic
//proxyServer.UpStreamHttpsProxy = new ExternalProxy("localhost", 8888);
// SOCKS proxy
//proxyServer.UpStreamHttpProxy = new ExternalProxy("46.63.0.17", 4145) { ProxyType = ExternalProxyType.Socks4 };
//proxyServer.UpStreamHttpsProxy = new ExternalProxy("46.63.0.17", 4145) { ProxyType = ExternalProxyType.Socks4 };
//proxyServer.UpStreamHttpProxy = new ExternalProxy("127.0.0.1", 1080)
// { ProxyType = ExternalProxyType.Socks5, UserName = "User1", Password = "Pass" };
//proxyServer.UpStreamHttpsProxy = new ExternalProxy("127.0.0.1", 1080)
// { ProxyType = ExternalProxyType.Socks5, UserName = "User1", Password = "Pass" };
//var socksEndPoint = new SocksProxyEndPoint(IPAddress.Any, 1080, true)
//{
......@@ -167,6 +174,12 @@ namespace Titanium.Web.Proxy.Examples.Basic
e.GetState().PipelineInfo.AppendLine(nameof(onBeforeTunnelConnectRequest) + ":" + hostname);
await writeToConsole("Tunnel to: " + hostname);
var clientLocalIp = e.ClientLocalEndPoint.Address;
if (!clientLocalIp.Equals(IPAddress.Loopback) && !clientLocalIp.Equals(IPAddress.IPv6Loopback))
{
e.HttpClient.UpStreamEndPoint = new IPEndPoint(clientLocalIp, 0);
}
if (hostname.Contains("dropbox.com"))
{
// Exclude Https addresses you don't want to proxy
......@@ -212,7 +225,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
{
e.GetState().PipelineInfo.AppendLine(nameof(onBeforeTunnelConnectResponse) + ":" + e.HttpClient.Request.RequestUri);
return Task.FromResult(false);
return Task.CompletedTask;
}
// intercept & cancel redirect or update requests
......@@ -356,7 +369,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
e.IsValid = true;
}
return Task.FromResult(0);
return Task.CompletedTask;
}
/// <summary>
......@@ -370,7 +383,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
// set e.clientCertificate to override
return Task.FromResult(0);
return Task.CompletedTask;
}
private async Task writeToConsole(string message, ConsoleColor? consoleColor = null)
......
......@@ -21,7 +21,7 @@ namespace WindowsServiceExample
{
// we do all this in here so we can reload settings with a simple restart
_proxyServerInstance = new ProxyServer();
_proxyServerInstance = new ProxyServer(false);
if (Properties.Settings.Default.ListeningPort <= 0 ||
Properties.Settings.Default.ListeningPort > 65535)
......
......@@ -53,7 +53,7 @@ namespace Titanium.Web.Proxy.EventArguments
{
BufferPool = server.BufferPool;
ExceptionFunc = server.ExceptionFunc;
TimeLine["Session Created"] = DateTime.Now;
TimeLine["Session Created"] = DateTime.UtcNow;
CancellationTokenSource = cancellationTokenSource;
......@@ -140,6 +140,11 @@ namespace Titanium.Web.Proxy.EventArguments
/// </summary>
public bool IsTransparent => ProxyEndPoint is TransparentProxyEndPoint;
/// <summary>
/// Is this a SOCKS endpoint?
/// </summary>
public bool IsSocks => ProxyEndPoint is SocksProxyEndPoint;
/// <summary>
/// The last exception that happened.
/// </summary>
......
......@@ -92,7 +92,7 @@ namespace Titanium.Web.Proxy.Http
/// <param name="serverConnection">Instance of <see cref="TcpServerConnection" /></param>
internal void SetConnection(TcpServerConnection serverConnection)
{
serverConnection.LastAccess = DateTime.Now;
serverConnection.LastAccess = DateTime.UtcNow;
connection = serverConnection;
}
......
......@@ -44,7 +44,6 @@ namespace Titanium.Web.Proxy.Network.Certificate
/// Makes the certificate.
/// </summary>
/// <param name="sSubjectCn">The s subject cn.</param>
/// <param name="isRoot">if set to <c>true</c> [is root].</param>
/// <param name="signingCert">The signing cert.</param>
/// <returns>X509Certificate2 instance.</returns>
public X509Certificate2 MakeCertificate(string sSubjectCn, X509Certificate2? signingCert = null)
......
using System;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using Org.BouncyCastle.Asn1;
using Org.BouncyCastle.Asn1.Pkcs;
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.Crypto.Operators;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Crypto.Prng;
using Org.BouncyCastle.Math;
using Org.BouncyCastle.OpenSsl;
using Org.BouncyCastle.Pkcs;
using Org.BouncyCastle.Security;
using Org.BouncyCastle.Utilities;
using Org.BouncyCastle.X509;
using Titanium.Web.Proxy.Helpers;
using Titanium.Web.Proxy.Shared;
using X509Certificate = Org.BouncyCastle.X509.X509Certificate;
namespace Titanium.Web.Proxy.Network.Certificate
{
/// <summary>
/// Implements certificate generation operations.
/// </summary>
internal class BCCertificateMakerFast : ICertificateMaker
{
private const int certificateValidDays = 1825;
private const int certificateGraceDays = 366;
// The FriendlyName value cannot be set on Unix.
// Set this flag to true when exception detected to avoid further exceptions
private static bool doNotSetFriendlyName;
private readonly ExceptionHandler exceptionFunc;
public AsymmetricCipherKeyPair KeyPair { get; set; }
internal BCCertificateMakerFast(ExceptionHandler exceptionFunc)
{
this.exceptionFunc = exceptionFunc;
KeyPair = GenerateKeyPair();
}
/// <summary>
/// Makes the certificate.
/// </summary>
/// <param name="sSubjectCn">The s subject cn.</param>
/// <param name="signingCert">The signing cert.</param>
/// <returns>X509Certificate2 instance.</returns>
public X509Certificate2 MakeCertificate(string sSubjectCn, X509Certificate2? signingCert = null)
{
return makeCertificateInternal(sSubjectCn, true, signingCert);
}
/// <summary>
/// Generates the certificate.
/// </summary>
/// <param name="subjectName">Name of the subject.</param>
/// <param name="issuerName">Name of the issuer.</param>
/// <param name="validFrom">The valid from.</param>
/// <param name="validTo">The valid to.</param>
/// <param name="subjectKeyPair">The key pair.</param>
/// <param name="signatureAlgorithm">The signature algorithm.</param>
/// <param name="issuerPrivateKey">The issuer private key.</param>
/// <param name="hostName">The host name</param>
/// <returns>X509Certificate2 instance.</returns>
/// <exception cref="PemException">Malformed sequence in RSA private key</exception>
private static X509Certificate2 generateCertificate(string? hostName,
string subjectName,
string issuerName, DateTime validFrom,
DateTime validTo, AsymmetricCipherKeyPair subjectKeyPair,
string signatureAlgorithm = "SHA256WithRSA",
AsymmetricKeyParameter? issuerPrivateKey = null)
{
// Generating Random Numbers
var randomGenerator = new CryptoApiRandomGenerator();
var secureRandom = new SecureRandom(randomGenerator);
// The Certificate Generator
var certificateGenerator = new X509V3CertificateGenerator();
// Serial Number
var serialNumber =
BigIntegers.CreateRandomInRange(BigInteger.One, BigInteger.ValueOf(long.MaxValue), secureRandom);
certificateGenerator.SetSerialNumber(serialNumber);
// Issuer and Subject Name
var subjectDn = new X509Name(subjectName);
var issuerDn = new X509Name(issuerName);
certificateGenerator.SetIssuerDN(issuerDn);
certificateGenerator.SetSubjectDN(subjectDn);
certificateGenerator.SetNotBefore(validFrom);
certificateGenerator.SetNotAfter(validTo);
if (hostName != null)
{
// add subject alternative names
var subjectAlternativeNames = new Asn1Encodable[] { new GeneralName(GeneralName.DnsName, hostName) };
var subjectAlternativeNamesExtension = new DerSequence(subjectAlternativeNames);
certificateGenerator.AddExtension(X509Extensions.SubjectAlternativeName.Id, false,
subjectAlternativeNamesExtension);
}
// Subject Public Key
certificateGenerator.SetPublicKey(subjectKeyPair.Public);
// Set certificate intended purposes to only Server Authentication
certificateGenerator.AddExtension(X509Extensions.ExtendedKeyUsage.Id, false,
new ExtendedKeyUsage(KeyPurposeID.IdKPServerAuth));
if (issuerPrivateKey == null)
{
certificateGenerator.AddExtension(X509Extensions.BasicConstraints.Id, true, new BasicConstraints(true));
}
var signatureFactory = new Asn1SignatureFactory(signatureAlgorithm,
issuerPrivateKey ?? subjectKeyPair.Private, secureRandom);
// Self-sign the certificate
var certificate = certificateGenerator.Generate(signatureFactory);
// Corresponding private key
var privateKeyInfo = PrivateKeyInfoFactory.CreatePrivateKeyInfo(subjectKeyPair.Private);
var seq = (Asn1Sequence)Asn1Object.FromByteArray(privateKeyInfo.ParsePrivateKey().GetDerEncoded());
if (seq.Count != 9)
{
throw new PemException("Malformed sequence in RSA private key");
}
var rsa = RsaPrivateKeyStructure.GetInstance(seq);
var rsaparams = new RsaPrivateCrtKeyParameters(rsa.Modulus, rsa.PublicExponent, rsa.PrivateExponent,
rsa.Prime1, rsa.Prime2, rsa.Exponent1,
rsa.Exponent2, rsa.Coefficient);
// Set private key onto certificate instance
var x509Certificate = withPrivateKey(certificate, rsaparams);
if (!doNotSetFriendlyName)
{
try
{
x509Certificate.FriendlyName = ProxyConstants.CNRemoverRegex.Replace(subjectName, string.Empty);
}
catch (PlatformNotSupportedException)
{
doNotSetFriendlyName = true;
}
}
return x509Certificate;
}
public AsymmetricCipherKeyPair GenerateKeyPair(int keyStrength = 2048)
{
var randomGenerator = new CryptoApiRandomGenerator();
var secureRandom = new SecureRandom(randomGenerator);
var keyGenerationParameters = new KeyGenerationParameters(secureRandom, keyStrength);
var keyPairGenerator = new RsaKeyPairGenerator();
keyPairGenerator.Init(keyGenerationParameters);
return keyPairGenerator.GenerateKeyPair();
}
private static X509Certificate2 withPrivateKey(X509Certificate certificate, AsymmetricKeyParameter privateKey)
{
const string password = "password";
Pkcs12Store store;
if(RunTime.IsRunningOnMono)
{
var builder = new Pkcs12StoreBuilder();
builder.SetUseDerEncoding(true);
store = builder.Build();
}
else
{
store = new Pkcs12Store();
}
var entry = new X509CertificateEntry(certificate);
store.SetCertificateEntry(certificate.SubjectDN.ToString(), entry);
store.SetKeyEntry(certificate.SubjectDN.ToString(), new AsymmetricKeyEntry(privateKey), new[] { entry });
using (var ms = new MemoryStream())
{
store.Save(ms, password.ToCharArray(), new SecureRandom(new CryptoApiRandomGenerator()));
return new X509Certificate2(ms.ToArray(), password, X509KeyStorageFlags.Exportable);
}
}
/// <summary>
/// Makes the certificate internal.
/// </summary>
/// <param name="hostName">hostname for certificate</param>
/// <param name="subjectName">The full subject.</param>
/// <param name="validFrom">The valid from.</param>
/// <param name="validTo">The valid to.</param>
/// <param name="signingCertificate">The signing certificate.</param>
/// <returns>X509Certificate2 instance.</returns>
/// <exception cref="System.ArgumentException">
/// You must specify a Signing Certificate if and only if you are not creating a
/// root.
/// </exception>
private X509Certificate2 makeCertificateInternal(string hostName, string subjectName,
DateTime validFrom, DateTime validTo, X509Certificate2? signingCertificate)
{
if (signingCertificate == null)
{
return generateCertificate(null, subjectName, subjectName, validFrom, validTo, KeyPair);
}
var kp = DotNetUtilities.GetKeyPair(signingCertificate.PrivateKey);
return generateCertificate(hostName, subjectName, signingCertificate.Subject, validFrom, validTo, KeyPair,
issuerPrivateKey: kp.Private);
}
/// <summary>
/// Makes the certificate internal.
/// </summary>
/// <param name="subject">The s subject cn.</param>
/// <param name="switchToMtaIfNeeded">if set to <c>true</c> [switch to MTA if needed].</param>
/// <param name="signingCert">The signing cert.</param>
/// <returns>X509Certificate2.</returns>
private X509Certificate2 makeCertificateInternal(string subject,
bool switchToMtaIfNeeded, X509Certificate2? signingCert = null)
{
return makeCertificateInternal(subject, $"CN={subject}",
DateTime.UtcNow.AddDays(-certificateGraceDays), DateTime.UtcNow.AddDays(certificateValidDays),
signingCert);
}
}
}
......@@ -105,7 +105,7 @@ namespace Titanium.Web.Proxy.Network.Certificate
// KeyLength
const int keyLength = 2048;
var now = DateTime.Now;
var now = DateTime.UtcNow;
var graceTime = now.AddDays(graceDays);
var certificate = makeCertificate(sSubjectCN, fullSubject, keyLength, hashAlgo, graceTime,
now.AddDays(validDays), signingCertificate);
......
......@@ -24,6 +24,8 @@ namespace Titanium.Web.Proxy.Network
/// </summary>
BouncyCastle = 0,
BouncyCastleFast = 2,
/// <summary>
/// Uses Windows Certification Generation API and only valid in Windows OS.
/// Observed to be faster than BouncyCastle.
......@@ -68,9 +70,19 @@ namespace Titanium.Web.Proxy.Network
{
if (certEngineValue == null)
{
certEngineValue = engine == CertificateEngine.BouncyCastle
? (ICertificateMaker)new BCCertificateMaker(ExceptionFunc)
: new WinCertificateMaker(ExceptionFunc);
switch (engine)
{
case CertificateEngine.BouncyCastle:
certEngineValue = new BCCertificateMaker(ExceptionFunc);
break;
case CertificateEngine.BouncyCastleFast:
certEngineValue = new BCCertificateMakerFast(ExceptionFunc);
break;
case CertificateEngine.DefaultWindows:
default:
certEngineValue = new WinCertificateMaker(ExceptionFunc);
break;
}
}
return certEngineValue;
......@@ -459,7 +471,7 @@ namespace Titanium.Web.Proxy.Network
// check in cache first
if (cachedCertificates.TryGetValue(certificateName, out var cached))
{
cached.LastAccess = DateTime.Now;
cached.LastAccess = DateTime.UtcNow;
return cached.Certificate;
}
......@@ -498,7 +510,7 @@ namespace Titanium.Web.Proxy.Network
var cancellationToken = clearCertificatesTokenSource.Token;
while (!cancellationToken.IsCancellationRequested)
{
var cutOff = DateTime.Now.AddMinutes(-CertificateCacheTimeOutMinutes);
var cutOff = DateTime.UtcNow.AddMinutes(-CertificateCacheTimeOutMinutes);
var outdated = cachedCertificates.Where(x => x.Value.LastAccess < cutOff).ToList();
......
......@@ -241,7 +241,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
if (cache.TryGetValue(cacheKey, out var existingConnections))
{
// +3 seconds for potential delay after getting connection
var cutOff = DateTime.Now.AddSeconds(-proxyServer.ConnectionTimeOutSeconds + 3);
var cutOff = DateTime.UtcNow.AddSeconds(-proxyServer.ConnectionTimeOutSeconds + 3);
while (existingConnections.Count > 0)
{
if (existingConnections.TryDequeue(out var recentConnection))
......@@ -350,7 +350,7 @@ retry:
if (sessionArgs != null)
{
sessionArgs.TimeLine["Dns Resolved"] = DateTime.Now;
sessionArgs.TimeLine["Dns Resolved"] = DateTime.UtcNow;
}
Array.Sort(ipAddresses, (x, y) => x.AddressFamily.CompareTo(y.AddressFamily));
......@@ -458,7 +458,7 @@ retry:
if (newUpstreamProxy != null)
{
sessionArgs.CustomUpStreamProxyUsed = newUpstreamProxy;
sessionArgs.TimeLine["Retrying Upstream Proxy Connection"] = DateTime.Now;
sessionArgs.TimeLine["Retrying Upstream Proxy Connection"] = DateTime.UtcNow;
return await createServerConnection(remoteHostName, remotePort, httpVersion, isHttps, sslProtocol, applicationProtocols, isConnect, proxyServer, sessionArgs, upStreamEndPoint, externalProxy, cacheKey, cancellationToken);
}
}
......@@ -468,7 +468,7 @@ retry:
if (sessionArgs != null)
{
sessionArgs.TimeLine["Connection Established"] = DateTime.Now;
sessionArgs.TimeLine["Connection Established"] = DateTime.UtcNow;
}
await proxyServer.InvokeServerConnectionCreateEvent(tcpServerSocket);
......@@ -532,7 +532,7 @@ retry:
if (sessionArgs != null)
{
sessionArgs.TimeLine["HTTPS Established"] = DateTime.Now;
sessionArgs.TimeLine["HTTPS Established"] = DateTime.UtcNow;
}
}
}
......@@ -570,7 +570,7 @@ retry:
return;
}
connection.LastAccess = DateTime.Now;
connection.LastAccess = DateTime.UtcNow;
try
{
......@@ -634,7 +634,7 @@ retry:
{
try
{
var cutOff = DateTime.Now.AddSeconds(-Server.ConnectionTimeOutSeconds);
var cutOff = DateTime.UtcNow.AddSeconds(-Server.ConnectionTimeOutSeconds);
foreach (var item in cache)
{
var queue = item.Value;
......
......@@ -20,7 +20,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
Version version, IExternalProxy? upStreamProxy, IPEndPoint? upStreamEndPoint, string cacheKey)
{
TcpSocket = tcpSocket;
LastAccess = DateTime.Now;
LastAccess = DateTime.UtcNow;
this.proxyServer = proxyServer;
this.proxyServer.UpdateServerConnectionCount(true);
Stream = stream;
......
......@@ -43,7 +43,7 @@ namespace Titanium.Web.Proxy.Network.WinAuth.Security
Credentials = new Common.SecurityHandle(0);
Context = new Common.SecurityHandle(0);
LastSeen = DateTime.Now;
LastSeen = DateTime.UtcNow;
AuthState = WinAuthState.UNAUTHORIZED;
}
......@@ -56,7 +56,7 @@ namespace Titanium.Web.Proxy.Network.WinAuth.Security
internal void UpdatePresence()
{
LastSeen = DateTime.Now;
LastSeen = DateTime.UtcNow;
}
}
}
......@@ -90,7 +90,7 @@ namespace Titanium.Web.Proxy
request.Method = requestLine.Method;
request.HttpVersion = requestLine.Version;
if (!args.IsTransparent)
if (!args.IsTransparent && !args.IsSocks)
{
// proxy authorization check
if (connectRequest == null && await checkAuthorization(args) == false)
......@@ -279,7 +279,7 @@ namespace Titanium.Web.Proxy
// set the connection and send request headers
args.HttpClient.SetConnection(connection);
args.TimeLine["Connection Ready"] = DateTime.Now;
args.TimeLine["Connection Ready"] = DateTime.UtcNow;
if (args.HttpClient.Request.UpgradeToWebSocket)
{
......@@ -335,7 +335,7 @@ namespace Titanium.Web.Proxy
}
}
args.TimeLine["Request Sent"] = DateTime.Now;
args.TimeLine["Request Sent"] = DateTime.UtcNow;
// parse and send response
await handleHttpSessionResponse(args);
......@@ -374,7 +374,7 @@ namespace Titanium.Web.Proxy
/// <returns></returns>
private async Task onBeforeRequest(SessionEventArgs args)
{
args.TimeLine["Request Received"] = DateTime.Now;
args.TimeLine["Request Received"] = DateTime.UtcNow;
if (BeforeRequest != null)
{
......
......@@ -32,7 +32,7 @@ namespace Titanium.Web.Proxy
await args.HttpClient.ReceiveResponse(cancellationToken);
}
args.TimeLine["Response Received"] = DateTime.Now;
args.TimeLine["Response Received"] = DateTime.UtcNow;
var response = args.HttpClient.Response;
args.ReRequest = false;
......@@ -99,7 +99,7 @@ namespace Titanium.Web.Proxy
response.Locked = true;
if (!args.IsTransparent)
if (!args.IsTransparent && !args.IsSocks)
{
response.Headers.FixProxyHeaders();
}
......@@ -122,7 +122,7 @@ namespace Titanium.Web.Proxy
}
}
args.TimeLine["Response Sent"] = DateTime.Now;
args.TimeLine["Response Sent"] = DateTime.UtcNow;
}
/// <summary>
......
using System;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Titanium.Web.Proxy.Extensions;
......@@ -48,13 +49,76 @@ namespace Titanium.Web.Proxy
}
else if (buffer[0] == 5)
{
if (buffer[1] == 0 || buffer[2] != 0)
int authenticationMethodCount = buffer[1];
if (read < authenticationMethodCount + 2)
{
return;
}
buffer[1] = 0;
int acceptedMethod = 255;
for (int i = 0; i < authenticationMethodCount; i++)
{
int method = buffer[i + 2];
if (method == 0 && ProxyBasicAuthenticateFunc == null)
{
acceptedMethod = 0;
break;
}
if (method == 2)
{
acceptedMethod = 2;
break;
}
}
buffer[1] = (byte)acceptedMethod;
await stream.WriteAsync(buffer, 0, 2, cancellationToken);
if (acceptedMethod == 255)
{
// no acceptable method
return;
}
if (acceptedMethod == 2)
{
read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
if (read < 3 || buffer[0] != 1)
{
// authentication version should be 1
return;
}
int userNameLength = buffer[1];
if (read < 3 + userNameLength)
{
return;
}
string userName = Encoding.ASCII.GetString(buffer, 2, userNameLength);
int passwordLength = buffer[2 + userNameLength];
if (read < 3 + userNameLength + passwordLength)
{
return;
}
string password = Encoding.ASCII.GetString(buffer, 3 + userNameLength, passwordLength);
bool success = true;
if (ProxySchemeAuthenticateFunc != null)
{
success = await ProxyBasicAuthenticateFunc.Invoke(null, userName, password);
}
buffer[1] = success ? (byte)0 : (byte)1;
await stream.WriteAsync(buffer, 0, 2, cancellationToken);
if (!success)
{
return;
}
}
read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
if (read < 10 || buffer[1] != 1)
{
......
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