2969 - re-issed code to address when developer doesn't have certificate installed.

This commit is contained in:
BaronGreenback 2020-04-26 19:35:36 +01:00
parent d1684b1053
commit a0a5512069

View File

@ -272,9 +272,7 @@ namespace Jellyfin.Server
{
_logger.LogInformation("Kestrel listening on {IpAddress}", address);
options.Listen(address, appHost.HttpPort);
if (appHost.EnableHttps)
{
if (appHost.Certificate != null)
if (appHost.EnableHttps && appHost.Certificate != null)
{
options.Listen(address, appHost.HttpsPort, listenOptions =>
{
@ -283,6 +281,8 @@ namespace Jellyfin.Server
});
}
else if (builderContext.HostingEnvironment.IsDevelopment())
{
try
{
options.Listen(address, appHost.HttpsPort, listenOptions =>
{
@ -290,6 +290,10 @@ namespace Jellyfin.Server
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
});
}
catch (Exception ex)
{
_logger.LogError(ex, "Error whilst listing to https - Is a development certificate installed?");
}
}
}
}
@ -298,9 +302,7 @@ namespace Jellyfin.Server
_logger.LogInformation("Kestrel listening on all interfaces");
options.ListenAnyIP(appHost.HttpPort);
if (appHost.EnableHttps)
{
if (appHost.Certificate != null)
if (appHost.EnableHttps && appHost.Certificate != null)
{
options.ListenAnyIP(appHost.HttpsPort, listenOptions =>
{
@ -309,6 +311,8 @@ namespace Jellyfin.Server
});
}
else if (builderContext.HostingEnvironment.IsDevelopment())
{
try
{
options.ListenAnyIP(appHost.HttpsPort, listenOptions =>
{
@ -316,6 +320,10 @@ namespace Jellyfin.Server
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
});
}
catch (Exception ex)
{
_logger.LogError(ex, "Error whilst listing to https - Is a development certificate installed?");
}
}
}
})