diff --git a/src/reverseproxy.js b/src/reverseproxy.js index 0ddbbc5dc..7b6d2b9f1 100644 --- a/src/reverseproxy.js +++ b/src/reverseproxy.js @@ -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 diff --git a/src/settings.js b/src/settings.js index 165e86c42..a6968f6dc 100644 --- a/src/settings.js +++ b/src/settings.js @@ -22,8 +22,6 @@ exports = module.exports = { getIPv6Config, setIPv6Config, - getReverseProxyConfig, // no setter yet since we have no UI for this - getUnstableAppsConfig, setUnstableAppsConfig, @@ -200,9 +198,6 @@ const gDefaults = (function () { retention: { keepWithinSecs: 2 * 24 * 60 * 60 }, // 2 days schedule: '00 00 23 * * *' // every day at 11pm }; - result[exports.REVERSE_PROXY_CONFIG_KEY] = { - ocsp: true - }; result[exports.SERVICES_CONFIG_KEY] = {}; result[exports.EXTERNAL_LDAP_KEY] = { provider: 'noop', @@ -629,12 +624,6 @@ async function setProfileConfig(directoryConfig) { notifyChange(exports.PROFILE_CONFIG_KEY, directoryConfig); } -async function getReverseProxyConfig() { - const value = await get(exports.REVERSE_PROXY_CONFIG_KEY); - if (value === null) return gDefaults[exports.REVERSE_PROXY_CONFIG_KEY]; - return JSON.parse(value); -} - async function getAppstoreListingConfig() { const value = await get(exports.APPSTORE_LISTING_CONFIG_KEY); if (value === null) return gDefaults[exports.APPSTORE_LISTING_CONFIG_KEY];