Remove the insecure ignoreCerts option.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-05-13 04:06:50 -07:00
parent ca9ab6168e
commit d661895545
7 changed files with 24 additions and 95 deletions

View File

@@ -20,12 +20,9 @@ interface RequestUtilResponse {
proxy: string | void | ProxyUtil.ProxyRule;
ecdhCurve: 'auto';
headers: { 'User-Agent': string };
rejectUnauthorized: boolean;
}
// ignoreCerts parameter helps in fetching server icon and
// other server details when user chooses to ignore certificate warnings
export function requestOptions(domain: string, ignoreCerts: boolean): RequestUtilResponse {
export function requestOptions(domain: string): RequestUtilResponse {
domain = formatUrl(domain);
const certificate = CertificateUtil.getCertificate(
encodeURIComponent(domain)
@@ -56,8 +53,7 @@ export function requestOptions(domain: string, ignoreCerts: boolean): RequestUti
ca: certificateLocation ? certificateLocation : '',
proxy: proxyEnabled ? ProxyUtil.getProxy(domain) : '',
ecdhCurve: 'auto',
headers: {'User-Agent': SystemUtil.getUserAgent()},
rejectUnauthorized: !ignoreCerts
headers: {'User-Agent': SystemUtil.getUserAgent()}
};
}