mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-23 14:10:40 +02:00
add error handling when loading cert
This commit is contained in:
parent
abb7bb4fd2
commit
2c64cc7d7d
|
@ -196,7 +196,9 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
|||
return new WebSocketSharpListener(_logger, cert, _memoryStreamProvider, _textEncoding, _networkManager, _socketFactory, _cryptoProvider, new StreamFactory(), enableDualMode, GetRequest);
|
||||
}
|
||||
|
||||
public static ICertificate GetCert(string certificateLocation)
|
||||
public ICertificate GetCert(string certificateLocation)
|
||||
{
|
||||
try
|
||||
{
|
||||
X509Certificate2 localCert = new X509Certificate2(certificateLocation);
|
||||
//localCert.PrivateKey = PrivateKey.CreateFromFile(pvk_file).RSA;
|
||||
|
@ -208,6 +210,12 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
|||
|
||||
return new Certificate(localCert);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error loading cert from {0}", ex, certificateLocation);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private IHttpRequest GetRequest(HttpListenerContext httpContext)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue