*Add method to check if we are in staging mode for ssl
This commit is contained in:
parent
ea4a993182
commit
e44a87e379
11
src/relay.ts
11
src/relay.ts
|
@ -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";
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue