add PEM fix hack for windows
This commit is contained in:
parent
181d77fc78
commit
d48ce6742a
1 changed files with 6 additions and 0 deletions
|
@ -43,6 +43,12 @@ public sealed class HttpServer
|
|||
|
||||
public HttpServer(int port, X509Certificate? certificate, RouterBase router)
|
||||
{
|
||||
if (OperatingSystem.IsWindows() && certificate is X509Certificate2 cert)
|
||||
{
|
||||
//Hack because SslStream is stupid on windows
|
||||
certificate = new X509Certificate2(cert.Export(X509ContentType.Pfx));
|
||||
}
|
||||
|
||||
listener = new TcpListener(IPAddress.Any, port);
|
||||
Certificate = certificate;
|
||||
Router = router;
|
||||
|
|
Loading…
Reference in a new issue