mirror of
https://github.com/bitwarden/server.git
synced 2024-12-31 18:27:49 +01:00
allows dev runs to load a common idserv cert (#881)
This commit is contained in:
parent
a8c20d1c32
commit
e41aca81de
@ -375,11 +375,7 @@ namespace Bit.Core.Utilities
|
||||
public static IIdentityServerBuilder AddIdentityServerCertificate(
|
||||
this IIdentityServerBuilder identityServerBuilder, IWebHostEnvironment env, GlobalSettings globalSettings)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
identityServerBuilder.AddDeveloperSigningCredential(false);
|
||||
}
|
||||
else if (globalSettings.SelfHosted &&
|
||||
if (globalSettings.SelfHosted &&
|
||||
CoreHelpers.SettingHasValue(globalSettings.IdentityServer.CertificatePassword)
|
||||
&& File.Exists("identity.pfx"))
|
||||
{
|
||||
@ -402,6 +398,10 @@ namespace Bit.Core.Utilities
|
||||
"identity.pfx", globalSettings.IdentityServer.CertificatePassword).GetAwaiter().GetResult();
|
||||
identityServerBuilder.AddSigningCredential(identityServerCert);
|
||||
}
|
||||
else if (env.IsDevelopment())
|
||||
{
|
||||
identityServerBuilder.AddDeveloperSigningCredential(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("No identity certificate to use.");
|
||||
|
Loading…
Reference in New Issue
Block a user