Skip to content

Commit

Permalink
Merge pull request #81 from dappnode/diego/overwrite-csr
Browse files Browse the repository at this point in the history
Allow CSR overwrite
  • Loading branch information
pablomendezroyo authored Aug 28, 2023
2 parents 3006a64 + 4d54aa9 commit 35230bc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/certificates/openssl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ async function generateDomainKey() {

async function createCSR(dappnodeDomain: string) {
if (fs.existsSync(config.csrPath)) {
console.log("Exists, skipping");
return;
console.log("CSR exists. Overwriting it...");
} else {
console.log("CSR does not exist. Creating it...");
}

await shell(
`openssl req -new -sha256 -key ${config.keyPath} -subj '/CN=${dappnodeDomain}' -addext 'subjectAltName = DNS:*.${dappnodeDomain}' > ${config.csrPath}`
);
Expand Down

0 comments on commit 35230bc

Please sign in to comment.