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:
parent
ed7d9f4541
commit
d0416a783f
@ -76,10 +76,13 @@ 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[]) {
|
||||||
const oldCAs = [https.globalAgent.options.ca].flat();
|
for (const cert of CAs) {
|
||||||
const injectedCAs = new Set([...oldCAs, ...CAs]);
|
if (Array.isArray(https.globalAgent.options.ca) && !https.globalAgent.options.ca.includes(cert)) {
|
||||||
|
https.globalAgent.options.ca.push(cert);
|
||||||
https.globalAgent.options.ca = [...injectedCAs];
|
} else {
|
||||||
|
https.globalAgent.options.ca = [cert];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user