Unverified Commit c653a8ef authored by honfika's avatar honfika Committed by GitHub

Mono fix?

parent f863fdc4
...@@ -143,8 +143,16 @@ namespace Titanium.Web.Proxy.Network.Certificate ...@@ -143,8 +143,16 @@ namespace Titanium.Web.Proxy.Network.Certificate
#if NET45 #if NET45
// Set private key onto certificate instance // Set private key onto certificate instance
var x509Certificate = new X509Certificate2(certificate.GetEncoded()); X509Certificate2 x509Certificate;
if (RunTime.IsRunningOnMono)
{
x509Certificate = withPrivateKey(certificate, rsaparams);
}
else
{
x509Certificate = new X509Certificate2(certificate.GetEncoded());
x509Certificate.PrivateKey = DotNetUtilities.ToRSA(rsaparams); x509Certificate.PrivateKey = DotNetUtilities.ToRSA(rsaparams);
}
#else #else
var x509Certificate = withPrivateKey(certificate, rsaparams); var x509Certificate = withPrivateKey(certificate, rsaparams);
#endif #endif
......
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