*Add method to check if we are in staging mode for ssl

This commit is contained in:
Derrick Hammer 2022-07-22 21:09:06 -04:00
parent ea4a993182
commit e44a87e379
1 changed files with 7 additions and 4 deletions

View File

@ -30,10 +30,9 @@ const sslParams: tls.SecureContextOptions = { cert: "", key: "" };
const sslPrivateKey = await acme.forge.createPrivateKey(); const sslPrivateKey = await acme.forge.createPrivateKey();
const acmeClient = new acme.Client({ const acmeClient = new acme.Client({
accountKey: sslPrivateKey, accountKey: sslPrivateKey,
directoryUrl: directoryUrl: isSSlStaging()
config.str("ssl-mode") === "staging" ? acme.directory.letsencrypt.staging
? acme.directory.letsencrypt.staging : acme.directory.letsencrypt.production,
: acme.directory.letsencrypt.production,
}); });
let app: Express; let app: Express;
@ -227,3 +226,7 @@ function getSeed(): Uint8Array {
return seed; return seed;
} }
function isSSlStaging() {
return config.str("ssl-mode") === "staging";
}