1
0
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:
Kyle Spearrin 2020-08-21 11:58:22 -04:00 committed by GitHub
parent a8c20d1c32
commit e41aca81de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.");