@ -297,7 +297,6 @@ namespace Jellyfin.Server
{
_logger . LogInformation ( "Kestrel listening on {IpAddress}" , address ) ;
options . Listen ( address , appHost . HttpPort ) ;
if ( appHost . EnableHttps & & appHost . Certificate ! = null )
{
options . Listen ( address , appHost . HttpsPort , listenOptions = >
@ -307,6 +306,8 @@ namespace Jellyfin.Server
} ) ;
}
else if ( builderContext . HostingEnvironment . IsDevelopment ( ) )
{
try
{
options . Listen ( address , appHost . HttpsPort , listenOptions = >
{
@ -314,6 +315,11 @@ namespace Jellyfin.Server
listenOptions . Protocols = HttpProtocols . Http1AndHttp2 ;
} ) ;
}
catch ( InvalidOperationException ex )
{
_logger . LogError ( ex , "Failed to listen to HTTPS using the ASP.NET Core HTTPS development certificate. Please ensure it has been installed and set as trusted." ) ;
}
}
}
}
else
@ -330,6 +336,8 @@ namespace Jellyfin.Server
} ) ;
}
else if ( builderContext . HostingEnvironment . IsDevelopment ( ) )
{
try
{
options . ListenAnyIP ( appHost . HttpsPort , listenOptions = >
{
@ -337,6 +345,11 @@ namespace Jellyfin.Server
listenOptions . Protocols = HttpProtocols . Http1AndHttp2 ;
} ) ;
}
catch ( InvalidOperationException ex )
{
_logger . LogError ( ex , "Failed to listen to HTTPS using the ASP.NET Core HTTPS development certificate. Please ensure it has been installed and set as trusted." ) ;
}
}
}
} )
. ConfigureAppConfiguration ( config = > config . ConfigureAppConfiguration ( commandLineOpts , appPaths , startupConfig ) )