Unverified Commit 6d1a583b authored by Jehonathan Thomas's avatar Jehonathan Thomas Committed by GitHub

Merge pull request #520 from justcoding121/master

Beta
parents 26e77586 2a57f752
...@@ -132,7 +132,7 @@ ...@@ -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> <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>
<span class="small pull-right mobile-hide"> <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/#L232">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L249">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_CertificateCacheTimeOutMinutes_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CertificateCacheTimeOutMinutes*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_CertificateCacheTimeOutMinutes" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CertificateCacheTimeOutMinutes">CertificateCacheTimeOutMinutes</h4>
...@@ -163,7 +163,7 @@ ...@@ -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> <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>
<span class="small pull-right mobile-hide"> <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/#L140">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L146">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_CertificateEngine_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CertificateEngine*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_CertificateEngine" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CertificateEngine">CertificateEngine</h4>
...@@ -191,17 +191,50 @@ Mono only support BouncyCastle and it is the default.</p> ...@@ -191,17 +191,50 @@ Mono only support BouncyCastle and it is the default.</p>
</tr> </tr>
</tbody> </tbody>
</table> </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_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/#L234">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>
<div class="markdown level1 summary"><p>The fake certificate cache storage.
The default cache storage implementation saves certificates in folder &quot;crts&quot; (will be created in proxy dll directory).
Implement ICertificateCache interface and assign concrete class here to customize.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public ICertificateCache CertificateStorage { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">ICertificateCache</span></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide"> <span class="small pull-right mobile-hide">
<span class="divider">|</span> <span class="divider">|</span>
<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> <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>
<span class="small pull-right mobile-hide"> <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/#L227">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L244">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_OverwritePfxFile_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.OverwritePfxFile*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_OverwritePfxFile" data-uid="Titanium.Web.Proxy.Network.CertificateManager.OverwritePfxFile">OverwritePfxFile</h4>
<div class="markdown level1 summary"><p>Overwrite Root certificate file. <div class="markdown level1 summary"><p>Overwrite Root certificate file.
<p>true : replace an existing .pfx file if password is incorect or if RootCertificate = null.</p></p> <p>true : replace an existing .pfx file if password is incorrect or if RootCertificate = null.</p></p>
</div> </div>
<div class="markdown level1 conceptual"></div> <div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5> <h5 class="decalaration">Declaration</h5>
...@@ -228,7 +261,7 @@ Mono only support BouncyCastle and it is the default.</p> ...@@ -228,7 +261,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_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> <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>
<span class="small pull-right mobile-hide"> <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/#L179">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L185">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_PfxFilePath_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.PfxFilePath*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_PfxFilePath" data-uid="Titanium.Web.Proxy.Network.CertificateManager.PfxFilePath">PfxFilePath</h4>
...@@ -263,7 +296,7 @@ Mono only support BouncyCastle and it is the default.</p> ...@@ -263,7 +296,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_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> <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>
<span class="small pull-right mobile-hide"> <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/#L170">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L176">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_PfxPassword_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.PfxPassword*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_PfxPassword" data-uid="Titanium.Web.Proxy.Network.CertificateManager.PfxPassword">PfxPassword</h4>
...@@ -295,7 +328,7 @@ Mono only support BouncyCastle and it is the default.</p> ...@@ -295,7 +328,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_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> <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>
<span class="small pull-right mobile-hide"> <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/#L207">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L213">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_RootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RootCertificate*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_RootCertificate" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RootCertificate">RootCertificate</h4>
...@@ -326,7 +359,7 @@ Mono only support BouncyCastle and it is the default.</p> ...@@ -326,7 +359,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_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> <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>
<span class="small pull-right mobile-hide"> <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/#L185">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L191">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_RootCertificateIssuerName_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RootCertificateIssuerName*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_RootCertificateIssuerName" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RootCertificateIssuerName">RootCertificateIssuerName</h4>
...@@ -358,7 +391,7 @@ Mono only support BouncyCastle and it is the default.</p> ...@@ -358,7 +391,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_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> <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>
<span class="small pull-right mobile-hide"> <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/#L198">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L204">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_RootCertificateName_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RootCertificateName*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_RootCertificateName" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RootCertificateName">RootCertificateName</h4>
...@@ -393,11 +426,11 @@ Root certificate file will be named as &quot;rootCert.pfx&quot;.</p> ...@@ -393,11 +426,11 @@ 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> <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>
<span class="small pull-right mobile-hide"> <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/#L227">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_SaveFakeCertificates_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.SaveFakeCertificates*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_SaveFakeCertificates" data-uid="Titanium.Web.Proxy.Network.CertificateManager.SaveFakeCertificates">SaveFakeCertificates</h4>
<div class="markdown level1 summary"><p>Save all fake certificates in folder &quot;crts&quot; (will be created in proxy dll directory). <div class="markdown level1 summary"><p>Save all fake certificates using <a class="xref" href="Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_CertificateStorage">CertificateStorage</a>.
<p>for can load the certificate and not make new certificate every time. </p></p> <p>for can load the certificate and not make new certificate every time. </p></p>
</div> </div>
<div class="markdown level1 conceptual"></div> <div class="markdown level1 conceptual"></div>
...@@ -425,7 +458,7 @@ Root certificate file will be named as &quot;rootCert.pfx&quot;.</p> ...@@ -425,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> <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>
<span class="small pull-right mobile-hide"> <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/#L237">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> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_StorageFlag_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.StorageFlag*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_StorageFlag" data-uid="Titanium.Web.Proxy.Network.CertificateManager.StorageFlag">StorageFlag</h4>
...@@ -458,7 +491,7 @@ Root certificate file will be named as &quot;rootCert.pfx&quot;.</p> ...@@ -458,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> <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>
<span class="small pull-right mobile-hide"> <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/#L905">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L887">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_ClearRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.ClearRootCertificate*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_ClearRootCertificate" data-uid="Titanium.Web.Proxy.Network.CertificateManager.ClearRootCertificate">ClearRootCertificate()</h4>
...@@ -474,7 +507,7 @@ Root certificate file will be named as &quot;rootCert.pfx&quot;.</p> ...@@ -474,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> <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>
<span class="small pull-right mobile-hide"> <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/#L548">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L522">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_CreateRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CreateRootCertificate*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_CreateRootCertificate_System_Boolean_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.CreateRootCertificate(System.Boolean)">CreateRootCertificate(Boolean)</h4>
...@@ -524,7 +557,7 @@ Root certificate file will be named as &quot;rootCert.pfx&quot;.</p> ...@@ -524,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_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> <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>
<span class="small pull-right mobile-hide"> <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/#L259">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_Dispose_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.Dispose*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_Dispose" data-uid="Titanium.Web.Proxy.Network.CertificateManager.Dispose">Dispose()</h4>
...@@ -540,7 +573,7 @@ Root certificate file will be named as &quot;rootCert.pfx&quot;.</p> ...@@ -540,7 +573,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> <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>
<span class="small pull-right mobile-hide"> <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/#L738">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L720">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_EnsureRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_EnsureRootCertificate" data-uid="Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate">EnsureRootCertificate()</h4>
...@@ -557,7 +590,7 @@ Also makes root certificate trusted based on initial setup from proxy constructo ...@@ -557,7 +590,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> <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>
<span class="small pull-right mobile-hide"> <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/#L769">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L751">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_EnsureRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.EnsureRootCertificate*"></a> <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> <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>
...@@ -607,7 +640,7 @@ prompting for UAC if required?</p> ...@@ -607,7 +640,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> <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>
<span class="small pull-right mobile-hide"> <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/#L790">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L772">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_IsRootCertificateMachineTrusted_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateMachineTrusted*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_IsRootCertificateMachineTrusted" data-uid="Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateMachineTrusted">IsRootCertificateMachineTrusted()</h4>
...@@ -638,7 +671,7 @@ prompting for UAC if required?</p> ...@@ -638,7 +671,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> <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>
<span class="small pull-right mobile-hide"> <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/#L782">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L764">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_IsRootCertificateUserTrusted_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateUserTrusted*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_IsRootCertificateUserTrusted" data-uid="Titanium.Web.Proxy.Network.CertificateManager.IsRootCertificateUserTrusted">IsRootCertificateUserTrusted()</h4>
...@@ -669,7 +702,7 @@ prompting for UAC if required?</p> ...@@ -669,7 +702,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> <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>
<span class="small pull-right mobile-hide"> <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/#L603">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L592">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_LoadRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_LoadRootCertificate" data-uid="Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate">LoadRootCertificate()</h4>
...@@ -700,7 +733,7 @@ prompting for UAC if required?</p> ...@@ -700,7 +733,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> <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>
<span class="small pull-right mobile-hide"> <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/#L639">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L621">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_LoadRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.LoadRootCertificate*"></a> <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> <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>
...@@ -737,7 +770,7 @@ named as &quot;rootCert.pfx&quot; (and will be saved in proxy dll directory).</p ...@@ -737,7 +770,7 @@ named as &quot;rootCert.pfx&quot; (and will be saved in proxy dll directory).</p
<tr> <tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td> <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
<td><span class="parametername">overwritePfXFile</span></td> <td><span class="parametername">overwritePfXFile</span></td>
<td><p>true : replace an existing .pfx file if password is incorect or if <td><p>true : replace an existing .pfx file if password is incorrect or if
RootCertificate==null.</p> RootCertificate==null.</p>
</td> </td>
</tr> </tr>
...@@ -769,7 +802,7 @@ RootCertificate==null.</p> ...@@ -769,7 +802,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> <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>
<span class="small pull-right mobile-hide"> <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/#L800">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L782">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_RemoveTrustedRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificate*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_RemoveTrustedRootCertificate_System_Boolean_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificate(System.Boolean)">RemoveTrustedRootCertificate(Boolean)</h4>
...@@ -804,7 +837,7 @@ To remove from machine store elevated permissions are required (will fail silent ...@@ -804,7 +837,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> <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>
<span class="small pull-right mobile-hide"> <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/#L824">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L806">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_RemoveTrustedRootCertificateAsAdmin_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificateAsAdmin*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_RemoveTrustedRootCertificateAsAdmin_System_Boolean_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.RemoveTrustedRootCertificateAsAdmin(System.Boolean)">RemoveTrustedRootCertificateAsAdmin(Boolean)</h4>
...@@ -853,7 +886,7 @@ To remove from machine store elevated permissions are required (will fail silent ...@@ -853,7 +886,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> <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>
<span class="small pull-right mobile-hide"> <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/#L656">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L638">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_TrustRootCertificate_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificate*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_TrustRootCertificate_System_Boolean_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificate(System.Boolean)">TrustRootCertificate(Boolean)</h4>
...@@ -887,7 +920,7 @@ Machine trust would require elevated permissions (will silently fail otherwise). ...@@ -887,7 +920,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> <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>
<span class="small pull-right mobile-hide"> <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/#L681">View Source</a> <a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L663">View Source</a>
</span> </span>
<a id="Titanium_Web_Proxy_Network_CertificateManager_TrustRootCertificateAsAdmin_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificateAsAdmin*"></a> <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> <h4 id="Titanium_Web_Proxy_Network_CertificateManager_TrustRootCertificateAsAdmin_System_Boolean_" data-uid="Titanium.Web.Proxy.Network.CertificateManager.TrustRootCertificateAsAdmin(System.Boolean)">TrustRootCertificateAsAdmin(Boolean)</h4>
...@@ -947,7 +980,7 @@ Prompts with UAC if elevated permissions are required. Works only on Windows.</p ...@@ -947,7 +980,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> <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>
<li> <li>
<a href="https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/src/Titanium.Web.Proxy/Network/CertificateManager.cs/#L39" class="contribution-link">View Source</a> <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>
</li> </li>
</ul> </ul>
</div> </div>
......
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
"api/Titanium.Web.Proxy.Network.CertificateManager.html": { "api/Titanium.Web.Proxy.Network.CertificateManager.html": {
"href": "api/Titanium.Web.Proxy.Network.CertificateManager.html", "href": "api/Titanium.Web.Proxy.Network.CertificateManager.html",
"title": "Class CertificateManager | Titanium Web Proxy", "title": "Class CertificateManager | Titanium Web Proxy",
"keywords": "Class CertificateManager A class to manage SSL certificates used by this proxy server. Inheritance Object CertificateManager Implements IDisposable Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Network Assembly : Titanium.Web.Proxy.dll Syntax public sealed class CertificateManager : IDisposable Properties | Improve this Doc View Source CertificateCacheTimeOutMinutes Minutes certificates should be kept in cache when not used. Declaration public int CertificateCacheTimeOutMinutes { get; set; } Property Value Type Description Int32 | Improve this Doc View Source CertificateEngine Select Certificate Engine. Optionally set to BouncyCastle. Mono only support BouncyCastle and it is the default. Declaration public CertificateEngine CertificateEngine { get; set; } Property Value Type Description CertificateEngine | Improve this Doc View Source OverwritePfxFile Overwrite Root certificate file. true : replace an existing .pfx file if password is incorect or if RootCertificate = null. Declaration public bool OverwritePfxFile { get; set; } Property Value Type Description Boolean | Improve this Doc View Source PfxFilePath Name(path) of the Root certificate file. Set the name(path) of the .pfx file. If it is string.Empty Root certificate file will be named as \"rootCert.pfx\" (and will be saved in proxy dll directory) Declaration public string PfxFilePath { get; set; } Property Value Type Description String | Improve this Doc View Source PfxPassword Password of the Root certificate file. Set a password for the .pfx file Declaration public string PfxPassword { get; set; } Property Value Type Description String | Improve this Doc View Source RootCertificate The root certificate. Declaration public X509Certificate2 RootCertificate { get; set; } Property Value Type Description X509Certificate2 | Improve this Doc View Source RootCertificateIssuerName Name of the root certificate issuer. (This is valid only when RootCertificate property is not set.) Declaration public string RootCertificateIssuerName { get; set; } Property Value Type Description String | Improve this Doc View Source RootCertificateName Name of the root certificate. (This is valid only when RootCertificate property is not set.) If no certificate is provided then a default Root Certificate will be created and used. The provided root certificate will be stored in proxy exe directory with the private key. Root certificate file will be named as \"rootCert.pfx\". Declaration public string RootCertificateName { get; set; } Property Value Type Description String | Improve this Doc View Source SaveFakeCertificates Save all fake certificates in folder \"crts\" (will be created in proxy dll directory). for can load the certificate and not make new certificate every time. Declaration public bool SaveFakeCertificates { get; set; } Property Value Type Description Boolean | Improve this Doc View Source StorageFlag Adjust behaviour when certificates are saved to filesystem. Declaration public X509KeyStorageFlags StorageFlag { get; set; } Property Value Type Description X509KeyStorageFlags Methods | Improve this Doc View Source ClearRootCertificate() Clear the root certificate and cache. Declaration public void ClearRootCertificate() | Improve this Doc View Source CreateRootCertificate(Boolean) Attempts to create a RootCertificate. Declaration public bool CreateRootCertificate(bool persistToFile = true) Parameters Type Name Description Boolean persistToFile if set to true try to load/save the certificate from rootCert.pfx. Returns Type Description Boolean true if succeeded, else false. | Improve this Doc View Source Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Declaration public void Dispose() | Improve this Doc View Source EnsureRootCertificate() Ensure certificates are setup (creates root if required). Also makes root certificate trusted based on initial setup from proxy constructor for user/machine trust. Declaration public void EnsureRootCertificate() | Improve this Doc View Source EnsureRootCertificate(Boolean, Boolean, Boolean) Ensure certificates are setup (creates root if required). Also makes root certificate trusted based on provided parameters. Note:setting machineTrustRootCertificate to true will force userTrustRootCertificate to true. Declaration public void EnsureRootCertificate(bool userTrustRootCertificate, bool machineTrustRootCertificate, bool trustRootCertificateAsAdmin = false) Parameters Type Name Description Boolean userTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's user certificate store? Boolean machineTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's certificate store? Boolean trustRootCertificateAsAdmin Should we attempt to trust certificates with elevated permissions by prompting for UAC if required? | Improve this Doc View Source IsRootCertificateMachineTrusted() Determines whether the root certificate is machine trusted. Declaration public bool IsRootCertificateMachineTrusted() Returns Type Description Boolean | Improve this Doc View Source IsRootCertificateUserTrusted() Determines whether the root certificate is trusted. Declaration public bool IsRootCertificateUserTrusted() Returns Type Description Boolean | Improve this Doc View Source LoadRootCertificate() Loads root certificate from current executing assembly location with expected name rootCert.pfx. Declaration public X509Certificate2 LoadRootCertificate() Returns Type Description X509Certificate2 | Improve this Doc View Source LoadRootCertificate(String, String, Boolean, X509KeyStorageFlags) Manually load a Root certificate file from give path (.pfx file). Declaration public bool LoadRootCertificate(string pfxFilePath, string password, bool overwritePfXFile = true, X509KeyStorageFlags storageFlag = X509KeyStorageFlags.Exportable) Parameters Type Name Description String pfxFilePath Set the name(path) of the .pfx file. If it is string.Empty Root certificate file will be named as \"rootCert.pfx\" (and will be saved in proxy dll directory). String password Set a password for the .pfx file. Boolean overwritePfXFile true : replace an existing .pfx file if password is incorect or if RootCertificate==null. X509KeyStorageFlags storageFlag Returns Type Description Boolean true if succeeded, else false. | Improve this Doc View Source RemoveTrustedRootCertificate(Boolean) Removes the trusted certificates from user store, optionally also from machine store. To remove from machine store elevated permissions are required (will fail silently otherwise). Declaration public void RemoveTrustedRootCertificate(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted Should also remove from machine store? | Improve this Doc View Source RemoveTrustedRootCertificateAsAdmin(Boolean) Removes the trusted certificates from user store, optionally also from machine store Declaration public bool RemoveTrustedRootCertificateAsAdmin(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted Returns Type Description Boolean Should also remove from machine store? | Improve this Doc View Source TrustRootCertificate(Boolean) Trusts the root certificate in user store, optionally also in machine store. Machine trust would require elevated permissions (will silently fail otherwise). Declaration public void TrustRootCertificate(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted | Improve this Doc View Source TrustRootCertificateAsAdmin(Boolean) Puts the certificate to the user store, optionally also to machine store. Prompts with UAC if elevated permissions are required. Works only on Windows. Declaration public bool TrustRootCertificateAsAdmin(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted Returns Type Description Boolean True if success. Implements System.IDisposable" "keywords": "Class CertificateManager A class to manage SSL certificates used by this proxy server. Inheritance Object CertificateManager Implements IDisposable Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Network Assembly : Titanium.Web.Proxy.dll Syntax public sealed class CertificateManager : IDisposable Properties | Improve this Doc View Source CertificateCacheTimeOutMinutes Minutes certificates should be kept in cache when not used. Declaration public int CertificateCacheTimeOutMinutes { get; set; } Property Value Type Description Int32 | Improve this Doc View Source CertificateEngine Select Certificate Engine. Optionally set to BouncyCastle. Mono only support BouncyCastle and it is the default. Declaration public CertificateEngine CertificateEngine { get; set; } Property Value Type Description CertificateEngine | Improve this Doc View Source CertificateStorage The fake certificate cache storage. The default cache storage implementation saves certificates in folder \"crts\" (will be created in proxy dll directory). Implement ICertificateCache interface and assign concrete class here to customize. Declaration public ICertificateCache CertificateStorage { get; set; } Property Value Type Description ICertificateCache | Improve this Doc View Source OverwritePfxFile Overwrite Root certificate file. true : replace an existing .pfx file if password is incorrect or if RootCertificate = null. Declaration public bool OverwritePfxFile { get; set; } Property Value Type Description Boolean | Improve this Doc View Source PfxFilePath Name(path) of the Root certificate file. Set the name(path) of the .pfx file. If it is string.Empty Root certificate file will be named as \"rootCert.pfx\" (and will be saved in proxy dll directory) Declaration public string PfxFilePath { get; set; } Property Value Type Description String | Improve this Doc View Source PfxPassword Password of the Root certificate file. Set a password for the .pfx file Declaration public string PfxPassword { get; set; } Property Value Type Description String | Improve this Doc View Source RootCertificate The root certificate. Declaration public X509Certificate2 RootCertificate { get; set; } Property Value Type Description X509Certificate2 | Improve this Doc View Source RootCertificateIssuerName Name of the root certificate issuer. (This is valid only when RootCertificate property is not set.) Declaration public string RootCertificateIssuerName { get; set; } Property Value Type Description String | Improve this Doc View Source RootCertificateName Name of the root certificate. (This is valid only when RootCertificate property is not set.) If no certificate is provided then a default Root Certificate will be created and used. The provided root certificate will be stored in proxy exe directory with the private key. Root certificate file will be named as \"rootCert.pfx\". Declaration public string RootCertificateName { get; set; } Property Value Type Description String | Improve this Doc View Source SaveFakeCertificates Save all fake certificates using CertificateStorage . for can load the certificate and not make new certificate every time. Declaration public bool SaveFakeCertificates { get; set; } Property Value Type Description Boolean | Improve this Doc View Source StorageFlag Adjust behaviour when certificates are saved to filesystem. Declaration public X509KeyStorageFlags StorageFlag { get; set; } Property Value Type Description X509KeyStorageFlags Methods | Improve this Doc View Source ClearRootCertificate() Clear the root certificate and cache. Declaration public void ClearRootCertificate() | Improve this Doc View Source CreateRootCertificate(Boolean) Attempts to create a RootCertificate. Declaration public bool CreateRootCertificate(bool persistToFile = true) Parameters Type Name Description Boolean persistToFile if set to true try to load/save the certificate from rootCert.pfx. Returns Type Description Boolean true if succeeded, else false. | Improve this Doc View Source Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Declaration public void Dispose() | Improve this Doc View Source EnsureRootCertificate() Ensure certificates are setup (creates root if required). Also makes root certificate trusted based on initial setup from proxy constructor for user/machine trust. Declaration public void EnsureRootCertificate() | Improve this Doc View Source EnsureRootCertificate(Boolean, Boolean, Boolean) Ensure certificates are setup (creates root if required). Also makes root certificate trusted based on provided parameters. Note:setting machineTrustRootCertificate to true will force userTrustRootCertificate to true. Declaration public void EnsureRootCertificate(bool userTrustRootCertificate, bool machineTrustRootCertificate, bool trustRootCertificateAsAdmin = false) Parameters Type Name Description Boolean userTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's user certificate store? Boolean machineTrustRootCertificate Should fake HTTPS certificate be trusted by this machine's certificate store? Boolean trustRootCertificateAsAdmin Should we attempt to trust certificates with elevated permissions by prompting for UAC if required? | Improve this Doc View Source IsRootCertificateMachineTrusted() Determines whether the root certificate is machine trusted. Declaration public bool IsRootCertificateMachineTrusted() Returns Type Description Boolean | Improve this Doc View Source IsRootCertificateUserTrusted() Determines whether the root certificate is trusted. Declaration public bool IsRootCertificateUserTrusted() Returns Type Description Boolean | Improve this Doc View Source LoadRootCertificate() Loads root certificate from current executing assembly location with expected name rootCert.pfx. Declaration public X509Certificate2 LoadRootCertificate() Returns Type Description X509Certificate2 | Improve this Doc View Source LoadRootCertificate(String, String, Boolean, X509KeyStorageFlags) Manually load a Root certificate file from give path (.pfx file). Declaration public bool LoadRootCertificate(string pfxFilePath, string password, bool overwritePfXFile = true, X509KeyStorageFlags storageFlag = X509KeyStorageFlags.Exportable) Parameters Type Name Description String pfxFilePath Set the name(path) of the .pfx file. If it is string.Empty Root certificate file will be named as \"rootCert.pfx\" (and will be saved in proxy dll directory). String password Set a password for the .pfx file. Boolean overwritePfXFile true : replace an existing .pfx file if password is incorrect or if RootCertificate==null. X509KeyStorageFlags storageFlag Returns Type Description Boolean true if succeeded, else false. | Improve this Doc View Source RemoveTrustedRootCertificate(Boolean) Removes the trusted certificates from user store, optionally also from machine store. To remove from machine store elevated permissions are required (will fail silently otherwise). Declaration public void RemoveTrustedRootCertificate(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted Should also remove from machine store? | Improve this Doc View Source RemoveTrustedRootCertificateAsAdmin(Boolean) Removes the trusted certificates from user store, optionally also from machine store Declaration public bool RemoveTrustedRootCertificateAsAdmin(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted Returns Type Description Boolean Should also remove from machine store? | Improve this Doc View Source TrustRootCertificate(Boolean) Trusts the root certificate in user store, optionally also in machine store. Machine trust would require elevated permissions (will silently fail otherwise). Declaration public void TrustRootCertificate(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted | Improve this Doc View Source TrustRootCertificateAsAdmin(Boolean) Puts the certificate to the user store, optionally also to machine store. Prompts with UAC if elevated permissions are required. Works only on Windows. Declaration public bool TrustRootCertificateAsAdmin(bool machineTrusted = false) Parameters Type Name Description Boolean machineTrusted Returns Type Description Boolean True if success. Implements System.IDisposable"
}, },
"api/Titanium.Web.Proxy.Network.html": { "api/Titanium.Web.Proxy.Network.html": {
"href": "api/Titanium.Web.Proxy.Network.html", "href": "api/Titanium.Web.Proxy.Network.html",
......
...@@ -2970,6 +2970,19 @@ references: ...@@ -2970,6 +2970,19 @@ references:
isSpec: "True" isSpec: "True"
fullName: Titanium.Web.Proxy.Network.CertificateManager.CertificateEngine fullName: Titanium.Web.Proxy.Network.CertificateManager.CertificateEngine
nameWithType: CertificateManager.CertificateEngine nameWithType: CertificateManager.CertificateEngine
- uid: Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage
name: CertificateStorage
href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_CertificateStorage
commentId: P:Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage
fullName: Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage
nameWithType: CertificateManager.CertificateStorage
- uid: Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage*
name: CertificateStorage
href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_CertificateStorage_
commentId: Overload:Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage
isSpec: "True"
fullName: Titanium.Web.Proxy.Network.CertificateManager.CertificateStorage
nameWithType: CertificateManager.CertificateStorage
- uid: Titanium.Web.Proxy.Network.CertificateManager.ClearRootCertificate - uid: Titanium.Web.Proxy.Network.CertificateManager.ClearRootCertificate
name: ClearRootCertificate() name: ClearRootCertificate()
href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_ClearRootCertificate href: api/Titanium.Web.Proxy.Network.CertificateManager.html#Titanium_Web_Proxy_Network_CertificateManager_ClearRootCertificate
......
using System; using System;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
namespace Titanium.Web.Proxy.Network namespace Titanium.Web.Proxy.Network
{ {
/// <summary> /// <summary>
/// An object that holds the cached certificate /// An object that holds the cached certificate
/// </summary> /// </summary>
internal class CachedCertificate internal sealed class CachedCertificate
{ {
internal CachedCertificate()
{
LastAccess = DateTime.Now;
}
internal X509Certificate2 Certificate { get; set; } internal X509Certificate2 Certificate { get; set; }
/// <summary> /// <summary>
/// last time this certificate was used /// Last time this certificate was used.
/// Usefull in determining its cache lifetime /// Useful in determining its cache lifetime.
/// </summary> /// </summary>
internal DateTime LastAccess { get; set; } internal DateTime LastAccess { get; set; }
} }
......
...@@ -4,8 +4,8 @@ using System.Collections.Generic; ...@@ -4,8 +4,8 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Titanium.Web.Proxy.Helpers; using Titanium.Web.Proxy.Helpers;
using Titanium.Web.Proxy.Network.Certificate; using Titanium.Web.Proxy.Network.Certificate;
...@@ -30,7 +30,6 @@ namespace Titanium.Web.Proxy.Network ...@@ -30,7 +30,6 @@ namespace Titanium.Web.Proxy.Network
/// Bug #468 Reported. /// Bug #468 Reported.
/// </summary> /// </summary>
DefaultWindows = 1 DefaultWindows = 1
} }
/// <summary> /// <summary>
...@@ -45,9 +44,21 @@ namespace Titanium.Web.Proxy.Network ...@@ -45,9 +44,21 @@ namespace Titanium.Web.Proxy.Network
/// <summary> /// <summary>
/// Cache dictionary /// Cache dictionary
/// </summary> /// </summary>
private readonly ConcurrentDictionary<string, CachedCertificate> certificateCache; private readonly ConcurrentDictionary<string, CachedCertificate> cachedCertificates
= new ConcurrentDictionary<string, CachedCertificate>();
/// <summary>
/// A list of pending certificate creation tasks.
/// Usefull to prevent multiple threads working on same certificate generation
/// when burst certificate generation requests happen for same certificate.
/// </summary>
private readonly ConcurrentDictionary<string, Task<X509Certificate2>> pendingCertificateCreationTasks
= new ConcurrentDictionary<string, Task<X509Certificate2>>();
private readonly ConcurrentDictionary<string, Task<X509Certificate2>> pendingCertificateCreationTasks; private readonly CancellationTokenSource clearCertificatesTokenSource
= new CancellationTokenSource();
private readonly object rootCertCreationLock = new object();
private ICertificateMaker certEngine; private ICertificateMaker certEngine;
...@@ -55,12 +66,12 @@ namespace Titanium.Web.Proxy.Network ...@@ -55,12 +66,12 @@ namespace Titanium.Web.Proxy.Network
private string issuer; private string issuer;
private bool pfxFileExists;
private X509Certificate2 rootCertificate; private X509Certificate2 rootCertificate;
private string rootCertificateName; private string rootCertificateName;
private ICertificateCache certificateCache = new DefaultCertificateDiskCache();
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="CertificateManager"/> class. /// Initializes a new instance of the <see cref="CertificateManager"/> class.
/// </summary> /// </summary>
...@@ -98,13 +109,8 @@ namespace Titanium.Web.Proxy.Network ...@@ -98,13 +109,8 @@ namespace Titanium.Web.Proxy.Network
} }
CertificateEngine = CertificateEngine.BouncyCastle; CertificateEngine = CertificateEngine.BouncyCastle;
certificateCache = new ConcurrentDictionary<string, CachedCertificate>();
pendingCertificateCreationTasks = new ConcurrentDictionary<string, Task<X509Certificate2>>();
} }
private bool clearCertificates { get; set; }
/// <summary> /// <summary>
/// Is the root certificate used by this proxy is valid? /// Is the root certificate used by this proxy is valid?
/// </summary> /// </summary>
...@@ -122,7 +128,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -122,7 +128,7 @@ namespace Titanium.Web.Proxy.Network
internal bool MachineTrustRoot { get; set; } internal bool MachineTrustRoot { get; set; }
/// <summary> /// <summary>
/// Whether trust operations should be done with elevated privillages /// Whether trust operations should be done with elevated privileges
/// Will prompt with UAC if required. Works only on Windows. /// Will prompt with UAC if required. Works only on Windows.
/// </summary> /// </summary>
internal bool TrustRootAsAdministrator { get; set; } internal bool TrustRootAsAdministrator { get; set; }
...@@ -215,14 +221,25 @@ namespace Titanium.Web.Proxy.Network ...@@ -215,14 +221,25 @@ namespace Titanium.Web.Proxy.Network
} }
/// <summary> /// <summary>
/// Save all fake certificates in folder "crts" (will be created in proxy dll directory). /// Save all fake certificates using <seealso cref="CertificateStorage"/>.
/// <para>for can load the certificate and not make new certificate every time. </para> /// <para>for can load the certificate and not make new certificate every time. </para>
/// </summary> /// </summary>
public bool SaveFakeCertificates { get; set; } = false; public bool SaveFakeCertificates { get; set; } = false;
/// <summary>
/// The fake certificate cache storage.
/// The default cache storage implementation saves certificates in folder "crts" (will be created in proxy dll directory).
/// Implement ICertificateCache interface and assign concrete class here to customize.
/// </summary>
public ICertificateCache CertificateStorage
{
get => certificateCache;
set => certificateCache = value ?? new DefaultCertificateDiskCache();
}
/// <summary> /// <summary>
/// Overwrite Root certificate file. /// Overwrite Root certificate file.
/// <para>true : replace an existing .pfx file if password is incorect or if RootCertificate = null.</para> /// <para>true : replace an existing .pfx file if password is incorrect or if RootCertificate = null.</para>
/// </summary> /// </summary>
public bool OverwritePfxFile { get; set; } = true; public bool OverwritePfxFile { get; set; } = true;
...@@ -241,52 +258,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -241,52 +258,7 @@ namespace Titanium.Web.Proxy.Network
/// </summary> /// </summary>
public void Dispose() public void Dispose()
{ {
} clearCertificatesTokenSource.Dispose();
private string getRootCertificateDirectory()
{
string assemblyLocation = Assembly.GetExecutingAssembly().Location;
// dynamically loaded assemblies returns string.Empty location
if (assemblyLocation == string.Empty)
{
assemblyLocation = Assembly.GetEntryAssembly().Location;
}
string path = Path.GetDirectoryName(assemblyLocation);
if (path == null)
{
throw new NullReferenceException();
}
return path;
}
private string getCertificatePath()
{
string path = getRootCertificateDirectory();
string certPath = Path.Combine(path, "crts");
if (!Directory.Exists(certPath))
{
Directory.CreateDirectory(certPath);
}
return certPath;
}
private string getRootCertificatePath()
{
string path = getRootCertificateDirectory();
string fileName = PfxFilePath;
if (fileName == string.Empty)
{
fileName = Path.Combine(path, "rootCert.pfx");
StorageFlag = X509KeyStorageFlags.Exportable;
}
return fileName;
} }
/// <summary> /// <summary>
...@@ -412,43 +384,37 @@ namespace Titanium.Web.Proxy.Network ...@@ -412,43 +384,37 @@ namespace Titanium.Web.Proxy.Network
/// <returns></returns> /// <returns></returns>
internal X509Certificate2 CreateCertificate(string certificateName, bool isRootCertificate) internal X509Certificate2 CreateCertificate(string certificateName, bool isRootCertificate)
{ {
X509Certificate2 certificate = null; X509Certificate2 certificate;
try try
{ {
if (!isRootCertificate && SaveFakeCertificates) if (!isRootCertificate && SaveFakeCertificates)
{ {
string path = getCertificatePath(); string subjectName = ProxyConstants.CNRemoverRegex
string subjectName = ProxyConstants.CNRemoverRegex.Replace(certificateName, string.Empty); .Replace(certificateName, string.Empty)
subjectName = subjectName.Replace("*", "$x$"); .Replace("*", "$x$");
string certificatePath = Path.Combine(path, subjectName + ".pfx");
if (!File.Exists(certificatePath)) try
{
certificate = certificateCache.LoadCertificate(subjectName, StorageFlag);
}
catch (Exception e)
{
ExceptionFunc(new Exception("Failed to load fake certificate.", e));
certificate = null;
}
if (certificate == null)
{ {
certificate = makeCertificate(certificateName, false); certificate = makeCertificate(certificateName, false);
// store as cache
try try
{ {
var exported = certificate.Export(X509ContentType.Pkcs12); certificateCache.SaveCertificate(subjectName, certificate);
File.WriteAllBytes(certificatePath, exported);
} }
catch (Exception e) catch (Exception e)
{ {
ExceptionFunc(new Exception("Failed to save fake certificate.", e)); ExceptionFunc(new Exception("Failed to save fake certificate.", e));
} }
}
else
{
try
{
certificate = new X509Certificate2(certificatePath, string.Empty, StorageFlag);
}
catch
{
// if load failed create again
certificate = makeCertificate(certificateName, false);
}
} }
} }
else else
...@@ -459,6 +425,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -459,6 +425,7 @@ namespace Titanium.Web.Proxy.Network
catch (Exception e) catch (Exception e)
{ {
ExceptionFunc(e); ExceptionFunc(e);
certificate = null;
} }
return certificate; return certificate;
...@@ -472,7 +439,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -472,7 +439,7 @@ namespace Titanium.Web.Proxy.Network
internal async Task<X509Certificate2> CreateCertificateAsync(string certificateName) internal async Task<X509Certificate2> CreateCertificateAsync(string certificateName)
{ {
// check in cache first // check in cache first
if (certificateCache.TryGetValue(certificateName, out var cached)) if (cachedCertificates.TryGetValue(certificateName, out var cached))
{ {
cached.LastAccess = DateTime.Now; cached.LastAccess = DateTime.Now;
return cached.Certificate; return cached.Certificate;
...@@ -491,7 +458,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -491,7 +458,7 @@ namespace Titanium.Web.Proxy.Network
var result = CreateCertificate(certificateName, false); var result = CreateCertificate(certificateName, false);
if (result != null) if (result != null)
{ {
certificateCache.TryAdd(certificateName, new CachedCertificate cachedCertificates.TryAdd(certificateName, new CachedCertificate
{ {
Certificate = result Certificate = result
}); });
...@@ -513,20 +480,27 @@ namespace Titanium.Web.Proxy.Network ...@@ -513,20 +480,27 @@ namespace Titanium.Web.Proxy.Network
/// </summary> /// </summary>
internal async void ClearIdleCertificates() internal async void ClearIdleCertificates()
{ {
clearCertificates = true; var cancellationToken = clearCertificatesTokenSource.Token;
while (clearCertificates) while (!cancellationToken.IsCancellationRequested)
{ {
var cutOff = DateTime.Now.AddMinutes(-1 * CertificateCacheTimeOutMinutes); var cutOff = DateTime.Now.AddMinutes(-1 * CertificateCacheTimeOutMinutes);
var outdated = certificateCache.Where(x => x.Value.LastAccess < cutOff).ToList(); var outdated = cachedCertificates.Where(x => x.Value.LastAccess < cutOff).ToList();
foreach (var cache in outdated) foreach (var cache in outdated)
{ {
certificateCache.TryRemove(cache.Key, out _); cachedCertificates.TryRemove(cache.Key, out _);
} }
// after a minute come back to check for outdated certificates in cache // after a minute come back to check for outdated certificates in cache
await Task.Delay(1000 * 60); try
{
await Task.Delay(1000 * 60, cancellationToken);
}
catch (TaskCanceledException)
{
return;
}
} }
} }
...@@ -535,7 +509,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -535,7 +509,7 @@ namespace Titanium.Web.Proxy.Network
/// </summary> /// </summary>
internal void StopClearIdleCertificates() internal void StopClearIdleCertificates()
{ {
clearCertificates = false; clearCertificatesTokenSource.Cancel();
} }
/// <summary> /// <summary>
...@@ -547,53 +521,68 @@ namespace Titanium.Web.Proxy.Network ...@@ -547,53 +521,68 @@ namespace Titanium.Web.Proxy.Network
/// </returns> /// </returns>
public bool CreateRootCertificate(bool persistToFile = true) public bool CreateRootCertificate(bool persistToFile = true)
{ {
if (persistToFile && RootCertificate == null) lock (rootCertCreationLock)
{
RootCertificate = LoadRootCertificate();
}
if (RootCertificate != null)
{ {
return true; if (persistToFile && RootCertificate == null)
} {
RootCertificate = LoadRootCertificate();
if (!OverwritePfxFile && pfxFileExists) }
{
return false;
}
try if (RootCertificate != null)
{ {
RootCertificate = CreateCertificate(RootCertificateName, true); return true;
} }
catch (Exception e)
{
ExceptionFunc(e);
}
if (persistToFile && RootCertificate != null) if (!OverwritePfxFile)
{
try
{ {
try try
{ {
Directory.Delete(getCertificatePath(), true); var rootCert = certificateCache.LoadRootCertificate(PfxFilePath, PfxPassword,
X509KeyStorageFlags.Exportable);
if (rootCert != null)
{
return false;
}
} }
catch catch
{ {
// ignore // root cert cannot be loaded
} }
}
string fileName = getRootCertificatePath(); try
File.WriteAllBytes(fileName, RootCertificate.Export(X509ContentType.Pkcs12, PfxPassword)); {
RootCertificate = CreateCertificate(RootCertificateName, true);
} }
catch (Exception e) catch (Exception e)
{ {
ExceptionFunc(e); ExceptionFunc(e);
} }
}
return RootCertificate != null; if (persistToFile && RootCertificate != null)
{
try
{
try
{
certificateCache.Clear();
}
catch
{
// ignore
}
certificateCache.SaveRootCertificate(PfxFilePath, PfxPassword, RootCertificate);
}
catch (Exception e)
{
ExceptionFunc(e);
}
}
return RootCertificate != null;
}
} }
/// <summary> /// <summary>
...@@ -602,16 +591,9 @@ namespace Titanium.Web.Proxy.Network ...@@ -602,16 +591,9 @@ namespace Titanium.Web.Proxy.Network
/// <returns></returns> /// <returns></returns>
public X509Certificate2 LoadRootCertificate() public X509Certificate2 LoadRootCertificate()
{ {
string fileName = getRootCertificatePath();
pfxFileExists = File.Exists(fileName);
if (!pfxFileExists)
{
return null;
}
try try
{ {
return new X509Certificate2(fileName, PfxPassword, StorageFlag); return certificateCache.LoadRootCertificate(PfxFilePath, PfxPassword, X509KeyStorageFlags.Exportable);
} }
catch (Exception e) catch (Exception e)
{ {
...@@ -629,7 +611,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -629,7 +611,7 @@ namespace Titanium.Web.Proxy.Network
/// </param> /// </param>
/// <param name="password">Set a password for the .pfx file.</param> /// <param name="password">Set a password for the .pfx file.</param>
/// <param name="overwritePfXFile"> /// <param name="overwritePfXFile">
/// true : replace an existing .pfx file if password is incorect or if /// true : replace an existing .pfx file if password is incorrect or if
/// RootCertificate==null. /// RootCertificate==null.
/// </param> /// </param>
/// <param name="storageFlag"></param> /// <param name="storageFlag"></param>
...@@ -861,7 +843,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -861,7 +843,7 @@ namespace Titanium.Web.Proxy.Network
ErrorDialog = false, ErrorDialog = false,
WindowStyle = ProcessWindowStyle.Hidden WindowStyle = ProcessWindowStyle.Hidden
}, },
// currentUser\Personal & currentMachine\Personal // currentUser\Personal & currentMachine\Personal
new ProcessStartInfo new ProcessStartInfo
{ {
...@@ -905,6 +887,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -905,6 +887,7 @@ namespace Titanium.Web.Proxy.Network
public void ClearRootCertificate() public void ClearRootCertificate()
{ {
certificateCache.Clear(); certificateCache.Clear();
cachedCertificates.Clear();
rootCertificate = null; rootCertificate = null;
} }
} }
......
using System;
using System.IO;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
namespace Titanium.Web.Proxy.Network
{
internal sealed class DefaultCertificateDiskCache : ICertificateCache
{
private const string defaultCertificateDirectoryName = "crts";
private const string defaultCertificateFileExtension = ".pfx";
private const string defaultRootCertificateFileName = "rootCert" + defaultCertificateFileExtension;
private string rootCertificatePath;
private string certificatePath;
public X509Certificate2 LoadRootCertificate(string name, string password, X509KeyStorageFlags storageFlags)
{
string filePath = getRootCertificatePath(name);
return loadCertificate(filePath, password, storageFlags);
}
public void SaveRootCertificate(string name, string password, X509Certificate2 certificate)
{
string filePath = getRootCertificatePath(name);
byte[] exported = certificate.Export(X509ContentType.Pkcs12, password);
File.WriteAllBytes(filePath, exported);
}
/// <inheritdoc />
public X509Certificate2 LoadCertificate(string subjectName, X509KeyStorageFlags storageFlags)
{
string filePath = Path.Combine(getCertificatePath(), subjectName + defaultCertificateFileExtension);
return loadCertificate(filePath, string.Empty, storageFlags);
}
/// <inheritdoc />
public void SaveCertificate(string subjectName, X509Certificate2 certificate)
{
string filePath = Path.Combine(getCertificatePath(), subjectName + defaultCertificateFileExtension);
byte[] exported = certificate.Export(X509ContentType.Pkcs12);
File.WriteAllBytes(filePath, exported);
}
public void Clear()
{
try
{
Directory.Delete(getCertificatePath(), true);
}
catch (DirectoryNotFoundException)
{
// do nothing
}
certificatePath = null;
}
private X509Certificate2 loadCertificate(string filePath, string password, X509KeyStorageFlags storageFlags)
{
byte[] exported;
try
{
exported = File.ReadAllBytes(filePath);
}
catch (IOException)
{
// file or directory not found
return null;
}
return new X509Certificate2(exported, password, storageFlags);
}
private string getRootCertificatePath(string filePath)
{
if (Path.IsPathRooted(filePath))
{
return filePath;
}
return Path.Combine(getRootCertificateDirectory(),
string.IsNullOrEmpty(filePath) ? defaultRootCertificateFileName : filePath);
}
private string getCertificatePath()
{
if (certificatePath == null)
{
string path = getRootCertificateDirectory();
string certPath = Path.Combine(path, defaultCertificateDirectoryName);
if (!Directory.Exists(certPath))
{
Directory.CreateDirectory(certPath);
}
certificatePath = certPath;
}
return certificatePath;
}
private string getRootCertificateDirectory()
{
if (rootCertificatePath == null)
{
string assemblyLocation = GetType().Assembly.Location;
// dynamically loaded assemblies returns string.Empty location
if (assemblyLocation == string.Empty)
{
assemblyLocation = Assembly.GetEntryAssembly().Location;
}
string path = Path.GetDirectoryName(assemblyLocation);
rootCertificatePath = path ?? throw new NullReferenceException();
}
return rootCertificatePath;
}
}
}
using System.Security.Cryptography.X509Certificates;
namespace Titanium.Web.Proxy.Network
{
public interface ICertificateCache
{
/// <summary>
/// Loads the root certificate from the storage.
/// </summary>
X509Certificate2 LoadRootCertificate(string name, string password, X509KeyStorageFlags storageFlags);
/// <summary>
/// Saves the root certificate to the storage.
/// </summary>
void SaveRootCertificate(string name, string password, X509Certificate2 certificate);
/// <summary>
/// Loads certificate from the storage. Returns true if certificate does not exist.
/// </summary>
X509Certificate2 LoadCertificate(string subjectName, X509KeyStorageFlags storageFlags);
/// <summary>
/// Stores certificate into the storage.
/// </summary>
void SaveCertificate(string subjectName, X509Certificate2 certificate);
/// <summary>
/// Clears the storage.
/// </summary>
void Clear();
}
}
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