mirror of
https://github.com/bitwarden/server.git
synced 2025-04-16 18:48:16 -05: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(
|
public static IIdentityServerBuilder AddIdentityServerCertificate(
|
||||||
this IIdentityServerBuilder identityServerBuilder, IWebHostEnvironment env, GlobalSettings globalSettings)
|
this IIdentityServerBuilder identityServerBuilder, IWebHostEnvironment env, GlobalSettings globalSettings)
|
||||||
{
|
{
|
||||||
if (env.IsDevelopment())
|
if (globalSettings.SelfHosted &&
|
||||||
{
|
|
||||||
identityServerBuilder.AddDeveloperSigningCredential(false);
|
|
||||||
}
|
|
||||||
else if (globalSettings.SelfHosted &&
|
|
||||||
CoreHelpers.SettingHasValue(globalSettings.IdentityServer.CertificatePassword)
|
CoreHelpers.SettingHasValue(globalSettings.IdentityServer.CertificatePassword)
|
||||||
&& File.Exists("identity.pfx"))
|
&& File.Exists("identity.pfx"))
|
||||||
{
|
{
|
||||||
@ -402,6 +398,10 @@ namespace Bit.Core.Utilities
|
|||||||
"identity.pfx", globalSettings.IdentityServer.CertificatePassword).GetAwaiter().GetResult();
|
"identity.pfx", globalSettings.IdentityServer.CertificatePassword).GetAwaiter().GetResult();
|
||||||
identityServerBuilder.AddSigningCredential(identityServerCert);
|
identityServerBuilder.AddSigningCredential(identityServerCert);
|
||||||
}
|
}
|
||||||
|
else if (env.IsDevelopment())
|
||||||
|
{
|
||||||
|
identityServerBuilder.AddDeveloperSigningCredential(false);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new Exception("No identity certificate to use.");
|
throw new Exception("No identity certificate to use.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user