mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Make it clear that we are using winca/api
Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
parent
4746e4cf41
commit
5d4d5d8162
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
import { isMac, isWindows } from "./vars";
|
import { isMac, isWindows } from "./vars";
|
||||||
// @ts-expect-error winca/api module doesn't have a type definition
|
// @ts-expect-error winca/api module doesn't have a type definition
|
||||||
import winca from "win-ca/api";
|
import wincaAPI from "win-ca/api";
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import { exec } from "child_process";
|
import { exec } from "child_process";
|
||||||
import { promisify } from "util";
|
import { promisify } from "util";
|
||||||
@ -50,8 +50,8 @@ export const getWinRootCA = (): Promise<string[]> => {
|
|||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
const CAs: string[] = [];
|
const CAs: string[] = [];
|
||||||
|
|
||||||
winca({
|
wincaAPI({
|
||||||
format: winca.der2.pem,
|
format: wincaAPI.der2.pem,
|
||||||
inject: false,
|
inject: false,
|
||||||
ondata: (ca: string) => {
|
ondata: (ca: string) => {
|
||||||
CAs.push(ca);
|
CAs.push(ca);
|
||||||
@ -80,14 +80,14 @@ if (isMac) {
|
|||||||
getMacRootCA().then((osxRootCAs) => {
|
getMacRootCA().then((osxRootCAs) => {
|
||||||
injectCAs(osxRootCAs);
|
injectCAs(osxRootCAs);
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.error(`[MAC-CA]: Error injecting root CAs from MacOSX. ${error?.message}`);
|
console.warn(`[MAC-CA]: Error injecting root CAs from MacOSX. ${error?.message}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isWindows) {
|
if (isWindows) {
|
||||||
getWinRootCA().then((winRootCAs) => {
|
getWinRootCA().then((winRootCAs) => {
|
||||||
winca.inject("+", winRootCAs);
|
wincaAPI.inject("+", winRootCAs);
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.error(`[WIN-CA]: Error injecting root CAs from Windows. ${error?.message}`);
|
console.warn(`[WIN-CA]: Error injecting root CAs from Windows. ${error?.message}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user