Skip to content

Commit

Permalink
Pass dhparamPath as arg
Browse files Browse the repository at this point in the history
  • Loading branch information
dappnodedev authored Jul 9, 2024
1 parent 783ac80 commit 5853e7c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/certificates/openssl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import fs from "fs";

const keyLength = 2048;

async function isDHParamValid() {
async function isDHParamValid(dhparamPath: string) {
try {
await shell(`openssl dhparam -check < ${path}`);
await shell(`openssl dhparam -check < ${dhparamPath}`);
return true;
} catch {
return false;
Expand All @@ -22,7 +22,7 @@ async function certExpiringDate(pem: string) {
}

async function generateDHParam() {
if (fs.existsSync(config.dhparamPath) && isDHParamValid()) {
if (fs.existsSync(config.dhparamPath) && isDHParamValid(config.dhparamPath)) {
console.log("Valid, skipping");
return;
}
Expand Down

0 comments on commit 5853e7c

Please sign in to comment.