diff --git a/NAPS2.Escl.Server/CertificateHelper.cs b/NAPS2.Escl.Server/CertificateHelper.cs index fa7d236ba5..df0ed765e3 100644 --- a/NAPS2.Escl.Server/CertificateHelper.cs +++ b/NAPS2.Escl.Server/CertificateHelper.cs @@ -27,7 +27,6 @@ static CertificateHelper() // See https://stackoverflow.com/a/65258808/2112909 public static X509Certificate2? GenerateSelfSignedCertificate(ILogger logger) { - return null; try { if (CertificateRequestType == null) @@ -42,12 +41,13 @@ static CertificateHelper() var extensions = (Collection) CertificateExtensionsProperty!.GetValue(request)!; extensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.KeyEncipherment, true)); - var now = DateTimeOffset.UtcNow; - var cert = (X509Certificate2) CreateSelfSignedMethod!.Invoke(request, - new object[] { now.AddDays(-1), now.AddYears(10) })!; - var pfxCert = new X509Certificate2(cert.Export(X509ContentType.Pfx)); - - return pfxCert; + return null; + // var now = DateTimeOffset.UtcNow; + // var cert = (X509Certificate2) CreateSelfSignedMethod!.Invoke(request, + // new object[] { now.AddDays(-1), now.AddYears(10) })!; + // var pfxCert = new X509Certificate2(cert.Export(X509ContentType.Pfx)); + // + // return pfxCert; } catch (Exception ex) {