new notification system
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { certificatesExist, generateSelfSignedCert, getLocalIPs, isOpenSSLAvailable } from "../certGenerator";
|
||||
import { logger } from "../logger";
|
||||
import { X509Certificate } from "crypto";
|
||||
import path from "path";
|
||||
|
||||
type TlsBootstrapParams = {
|
||||
@@ -119,6 +120,15 @@ export async function prepareTlsOptions(params: TlsBootstrapParams): Promise<Tls
|
||||
}
|
||||
}
|
||||
|
||||
if (source === "configured" && tlsOptions.cert) {
|
||||
try {
|
||||
const x509 = new X509Certificate(tlsOptions.cert);
|
||||
if (x509.issuer === x509.subject) {
|
||||
source = "self-signed";
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
return {
|
||||
tlsOptions,
|
||||
certPathUsed: params.certPath,
|
||||
|
||||
Reference in New Issue
Block a user