The Free Software Media System - Server Backend & API
Bind HTTPS ports when running with development environment flag
Mark Monteiro54cbf9c4dc81
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.csindex e9e852349c..3d082d86bc 100644--- a/Jellyfin.Server/Program.cs+++ b/Jellyfin.Server/Program.cs@@ -20,9 +20,11 @@ using MediaBrowser.Common.Configuration;using MediaBrowser.Controller.Drawing;using MediaBrowser.Model.Globalization;using Microsoft.AspNetCore.Hosting;+using Microsoft.AspNetCore.Server.Kestrel.Core;using Microsoft.Extensions.Configuration;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.DependencyInjection.Extensions;+using Microsoft.Extensions.Hosting;using Microsoft.Extensions.Logging;using Microsoft.Extensions.Logging.Abstractions;using Serilog;@@ -236,7 +238,7 @@ namespace Jellyfin.Serverprivate static IWebHostBuilder CreateWebHostBuilder(ApplicationHost appHost, IServiceCollection serviceCollection, IApplicationPaths appPaths){return new WebHostBuilder()- .UseKestrel(options =>+ .UseKestrel((builderContext, options) =>{var addresses = appHost.ServerConfigurationManager.Configuration@@ -258,6 +260,14 @@ namespace Jellyfin.ServerappHost.HttpsPort,listenOptions => listenOptions.UseHttps(appHost.Certificate));}+ else if (builderContext.HostingEnvironment.IsDevelopment())+ {+ options.Listen(address, appHost.HttpsPort, listenOptions =>+ {+ listenOptions.UseHttps();+ listenOptions.Protocols = HttpProtocols.Http1AndHttp2;+ });+ }}}else@@ -271,6 +281,14 @@ namespace Jellyfin.ServerappHost.HttpsPort,listenOptions => listenOptions.UseHttps(appHost.Certificate));}+ else if (builderContext.HostingEnvironment.IsDevelopment())+ {+ options.ListenAnyIP(appHost.HttpsPort, listenOptions =>+ {+ listenOptions.UseHttps();+ listenOptions.Protocols = HttpProtocols.Http1AndHttp2;+ });+ }}}).ConfigureAppConfiguration(config => config.ConfigureAppConfiguration(appPaths))