async function getCertFile()

in lib/CertificateTools.js [212:235]


async function getCertFile(config, silent) {
    if (typeof silent === "undefined") {
        silent = false;
    }
    let cert = path.join(__dirname, '..', config.server.certificate);
    let pfx = path.join(__dirname, '..', config.server.pfx);

    if (await fs.exists(cert)) {
        return cert;
    }
    if (await fs.exists(pfx)) {
        if (config.server.passphrase) {
            if (!silent) {
                ConsoleWriter.info(`Use '${config.server.passphrase}' passphrase to install PFX certificate.`);
            }
        }
        return pfx;
    }

    if (!silent) {
        ConsoleWriter.info('Certificate not found. Call `pbiviz --install-cert` command to create the new certificate');
    }
    return null;
}