Adapt per review

This commit is contained in:
Reinier Criel 2026-04-14 11:30:29 -07:00
parent 63b7a5ee5e
commit 6ff2ee3367
20 changed files with 118 additions and 119 deletions

View file

@ -1,16 +1,12 @@
import forge from "node-forge";
import path from "path";
import fs from "fs";
import { getSafeChainBaseDir } from "../config/safeChainDir.js";
import { getCertsDir } from "../config/safeChainDir.js";
const ca = loadCa();
const certCache = new Map();
function getCertFolder() {
return path.join(getSafeChainBaseDir(), "certs");
}
/**
* @param {forge.pki.PublicKey} publicKey
* @returns {string}
@ -23,7 +19,7 @@ function createKeyIdentifier(publicKey) {
}
export function getCaCertPath() {
return path.join(getCertFolder(), "ca-cert.pem");
return path.join(getCertsDir(), "ca-cert.pem");
}
/**
@ -115,7 +111,7 @@ export function generateCertForHost(hostname) {
}
function loadCa() {
const certFolder = getCertFolder();
const certFolder = getCertsDir();
const keyPath = path.join(certFolder, "ca-key.pem");
const certPath = path.join(certFolder, "ca-cert.pem");