Commit bfd6e9e8 authored by Honfika's avatar Honfika

a

parent 0b64df4f
......@@ -28,6 +28,10 @@ namespace Titanium.Web.Proxy.Network.Certificate
private const int certificateValidDays = 1825;
private const int certificateGraceDays = 366;
// The FriendlyName value cannot be set on Unix.
// Set this flag to true when exception detected to avoid further exceptions
private static bool doNotSetFriendlyName;
/// <summary>
/// Makes the certificate.
/// </summary>
......@@ -126,13 +130,17 @@ namespace Titanium.Web.Proxy.Network.Certificate
// Set private key onto certificate instance
var x509Certificate = new X509Certificate2(certificate.GetEncoded());
x509Certificate.PrivateKey = DotNetUtilities.ToRSA(rsaparams);
try
{
x509Certificate.FriendlyName = subjectName;
}
catch (PlatformNotSupportedException)
if (!doNotSetFriendlyName)
{
// The FriendlyName value cannot be set on Unix.
try
{
x509Certificate.FriendlyName = subjectName;
}
catch (PlatformNotSupportedException)
{
doNotSetFriendlyName = true;
}
}
return x509Certificate;
......
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