http in development mode crashed -

pull/2969/head
Admin 5 years ago
parent aa6d52277d
commit d1684b1053

@ -272,22 +272,24 @@ namespace Jellyfin.Server
{ {
_logger.LogInformation("Kestrel listening on {IpAddress}", address); _logger.LogInformation("Kestrel listening on {IpAddress}", address);
options.Listen(address, appHost.HttpPort); options.Listen(address, appHost.HttpPort);
if (appHost.EnableHttps)
if (appHost.EnableHttps && appHost.Certificate != null)
{ {
options.Listen(address, appHost.HttpsPort, listenOptions => if (appHost.Certificate != null)
{ {
listenOptions.UseHttps(appHost.Certificate); options.Listen(address, appHost.HttpsPort, listenOptions =>
listenOptions.Protocols = HttpProtocols.Http1AndHttp2; {
}); listenOptions.UseHttps(appHost.Certificate);
} listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
else if (builderContext.HostingEnvironment.IsDevelopment()) });
{ }
options.Listen(address, appHost.HttpsPort, listenOptions => else if (builderContext.HostingEnvironment.IsDevelopment())
{ {
listenOptions.UseHttps(); options.Listen(address, appHost.HttpsPort, listenOptions =>
listenOptions.Protocols = HttpProtocols.Http1AndHttp2; {
}); listenOptions.UseHttps();
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
});
}
} }
} }
} }
@ -296,21 +298,24 @@ namespace Jellyfin.Server
_logger.LogInformation("Kestrel listening on all interfaces"); _logger.LogInformation("Kestrel listening on all interfaces");
options.ListenAnyIP(appHost.HttpPort); options.ListenAnyIP(appHost.HttpPort);
if (appHost.EnableHttps && appHost.Certificate != null) if (appHost.EnableHttps)
{ {
options.ListenAnyIP(appHost.HttpsPort, listenOptions => if (appHost.Certificate != null)
{ {
listenOptions.UseHttps(appHost.Certificate); options.ListenAnyIP(appHost.HttpsPort, listenOptions =>
listenOptions.Protocols = HttpProtocols.Http1AndHttp2; {
}); listenOptions.UseHttps(appHost.Certificate);
} listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
else if (builderContext.HostingEnvironment.IsDevelopment()) });
{ }
options.ListenAnyIP(appHost.HttpsPort, listenOptions => else if (builderContext.HostingEnvironment.IsDevelopment())
{ {
listenOptions.UseHttps(); options.ListenAnyIP(appHost.HttpsPort, listenOptions =>
listenOptions.Protocols = HttpProtocols.Http1AndHttp2; {
}); listenOptions.UseHttps();
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
});
}
} }
} }
}) })

Loading…
Cancel
Save