settings: move reverse proxy config

This commit is contained in:
Girish Ramakrishnan
2023-08-02 19:22:53 +05:30
parent c4a8255fdd
commit c7f2a04e8c
2 changed files with 7 additions and 12 deletions

View File

@@ -87,9 +87,15 @@ function getCertificateDatesSync(cert) {
return { startDate: notBeforeDate, endDate: notAfterDate };
}
async function getReverseProxyConfig() {
const value = await settings.get(settings.REVERSE_PROXY_CONFIG_KEY);
if (value === null) return { ocsp: true };
return JSON.parse(value);
}
async function isOcspEnabled(certFilePath) {
// on some servers, OCSP does not work. see #796
const config = await settings.getReverseProxyConfig();
const config = await getReverseProxyConfig();
if (!config.ocsp) return false;
// We used to check for the must-staple in the cert using openssl x509 -text -noout -in ${certFilePath} | grep -q status_request