From 2798b798acd66412e4fa7cf745149aaa348c8cb9 Mon Sep 17 00:00:00 2001 From: dappnodedev Date: Wed, 10 Jul 2024 09:38:07 +0200 Subject: [PATCH] Get DH param path from config --- src/certificates/openssl.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/certificates/openssl.ts b/src/certificates/openssl.ts index db0edf3..eb62e84 100644 --- a/src/certificates/openssl.ts +++ b/src/certificates/openssl.ts @@ -5,9 +5,9 @@ import fs from "fs"; const keyLength = 2048; -async function isDHParamValid(dhparamPath: string) { +async function isDHParamValid() { try { - await shell(`openssl dhparam -check < ${dhparamPath}`); + await shell(`openssl dhparam -check < ${config.dhparamPath}`); return true; } catch { return false; @@ -22,7 +22,7 @@ async function certExpiringDate(pem: string) { } async function generateDHParam() { - if (fs.existsSync(config.dhparamPath) && isDHParamValid(config.dhparamPath)) { + if (fs.existsSync(config.dhparamPath) && isDHParamValid()) { console.log("Valid, skipping"); return; }