mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-05 07:18:47 +01:00
Merge pull request #2636 from mark-monteiro/development-https
Use ASP.NET Core HTTPS Development Certificate
This commit is contained in:
@@ -25,6 +25,7 @@ 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;
|
||||
@@ -259,7 +260,7 @@ namespace Jellyfin.Server
|
||||
IApplicationPaths appPaths)
|
||||
{
|
||||
return new WebHostBuilder()
|
||||
.UseKestrel(options =>
|
||||
.UseKestrel((builderContext, options) =>
|
||||
{
|
||||
var addresses = appHost.ServerConfigurationManager
|
||||
.Configuration
|
||||
@@ -282,6 +283,14 @@ namespace Jellyfin.Server
|
||||
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
|
||||
});
|
||||
}
|
||||
else if (builderContext.HostingEnvironment.IsDevelopment())
|
||||
{
|
||||
options.Listen(address, appHost.HttpsPort, listenOptions =>
|
||||
{
|
||||
listenOptions.UseHttps();
|
||||
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -297,6 +306,14 @@ namespace Jellyfin.Server
|
||||
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
|
||||
});
|
||||
}
|
||||
else if (builderContext.HostingEnvironment.IsDevelopment())
|
||||
{
|
||||
options.ListenAnyIP(appHost.HttpsPort, listenOptions =>
|
||||
{
|
||||
listenOptions.UseHttps();
|
||||
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
.ConfigureAppConfiguration(config => config.ConfigureAppConfiguration(commandLineOpts, appPaths, startupConfig))
|
||||
|
||||
Reference in New Issue
Block a user