1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
Hung-Han (Henry) Chen 2021-11-02 16:42:01 +02:00
parent aa7645347f
commit ed7d9f4541
No known key found for this signature in database
GPG Key ID: 54B44603D251B788

View File

@ -76,13 +76,10 @@ export function getWinRootCA (): Promise<string[]> {
* Add (or merge) CAs to https.globalAgent.options.ca * Add (or merge) CAs to https.globalAgent.options.ca
*/ */
export function injectCAs(CAs: string[]) { export function injectCAs(CAs: string[]) {
for (const cert of CAs) { const oldCAs = [https.globalAgent.options.ca].flat();
if (Array.isArray(https.globalAgent.options.ca) && !https.globalAgent.options.ca.includes(cert)) { const injectedCAs = new Set([...oldCAs, ...CAs]);
https.globalAgent.options.ca.push(cert);
} else { https.globalAgent.options.ca = [...injectedCAs];
https.globalAgent.options.ca = [cert];
}
}
} }
/** /**