drop-server-bak/server/plugins/ca.ts

16 lines
442 B
TypeScript
Raw Permalink Normal View History

2024-10-07 22:35:54 +11:00
import { CertificateAuthority } from "../internal/clients/ca";
import { dbCertificateStore } from "../internal/clients/ca-store";
2024-10-07 22:35:54 +11:00
let ca: CertificateAuthority | undefined;
export const useCertificateAuthority = () => {
2024-10-07 22:35:54 +11:00
if (!ca) throw new Error("CA not initialised");
return ca;
};
export default defineNitroPlugin(async () => {
2025-05-10 16:18:28 -04:00
// const store = fsCertificateStore();
2024-10-07 22:35:54 +11:00
2025-03-14 10:53:37 -04:00
ca = await CertificateAuthority.new(dbCertificateStore());
2024-10-07 22:35:54 +11:00
});