1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00

Increase self-signed certs duration (#570)

This commit is contained in:
Mart124 2019-10-02 16:26:07 +02:00 committed by Kyle Spearrin
parent 003a0802a7
commit 6f91b693d9

View File

@ -43,7 +43,7 @@ namespace Bit.Setup
_context.Config.Ssl = true; _context.Config.Ssl = true;
_context.Install.Trusted = false; _context.Install.Trusted = false;
_context.Install.SelfSignedCert = true; _context.Install.SelfSignedCert = true;
Helpers.Exec("openssl req -x509 -newkey rsa:4096 -sha256 -nodes -days 365 " + Helpers.Exec("openssl req -x509 -newkey rsa:4096 -sha256 -nodes -days 36500 " +
$"-keyout /bitwarden/ssl/self/{_context.Install.Domain}/private.key " + $"-keyout /bitwarden/ssl/self/{_context.Install.Domain}/private.key " +
$"-out /bitwarden/ssl/self/{_context.Install.Domain}/certificate.crt " + $"-out /bitwarden/ssl/self/{_context.Install.Domain}/certificate.crt " +
$"-reqexts SAN -extensions SAN " + $"-reqexts SAN -extensions SAN " +
@ -70,7 +70,7 @@ namespace Bit.Setup
_context.Install.IdentityCertPassword = Helpers.SecureRandomString(32, alpha: true, numeric: true); _context.Install.IdentityCertPassword = Helpers.SecureRandomString(32, alpha: true, numeric: true);
Directory.CreateDirectory("/bitwarden/identity/"); Directory.CreateDirectory("/bitwarden/identity/");
Helpers.Exec("openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout identity.key " + Helpers.Exec("openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout identity.key " +
"-out identity.crt -subj \"/CN=Bitwarden IdentityServer\" -days 10950"); "-out identity.crt -subj \"/CN=Bitwarden IdentityServer\" -days 36500");
Helpers.Exec("openssl pkcs12 -export -out /bitwarden/identity/identity.pfx -inkey identity.key " + Helpers.Exec("openssl pkcs12 -export -out /bitwarden/identity/identity.pfx -inkey identity.key " +
$"-in identity.crt -certfile identity.crt -passout pass:{_context.Install.IdentityCertPassword}"); $"-in identity.crt -certfile identity.crt -passout pass:{_context.Install.IdentityCertPassword}");