Skip to content

Commit 4bca542

Browse files
committed
chore: use allowSelfSigned naming instead of switching to ignoreSSLErrors
1 parent b4ac271 commit 4bca542

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/lib/ggshield-configuration-utils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,25 @@ import { getGGShield } from "./ggshield-resolver-utils";
99
*/
1010
export async function getConfiguration(
1111
context: ExtensionContext,
12-
outputChannel: OutputChannel
12+
outputChannel: OutputChannel,
1313
): Promise<GGShieldConfiguration> {
1414
const config = workspace.getConfiguration("gitguardian");
1515

1616
const ggshieldPath: string | undefined = config.get("GGShieldPath");
1717
const apiUrl: string | undefined = config.get("apiUrl");
1818
const allowSelfSigned: boolean = config.get("allowSelfSigned", false);
19-
const ignoreSSLErrors = allowSelfSigned;
2019

2120
const pathToGGShield: string = await getGGShield(
2221
os.platform(),
2322
os.arch(),
2423
context,
2524
outputChannel,
26-
ignoreSSLErrors
25+
allowSelfSigned,
2726
);
2827

2928
return new GGShieldConfiguration(
3029
pathToGGShield,
3130
apiUrl,
32-
allowSelfSigned || false
31+
allowSelfSigned || false,
3332
);
3433
}

src/lib/ggshield-resolver-utils.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function getGGShield(
3636
arch: string,
3737
context: ExtensionContext,
3838
outputChannel: OutputChannel,
39-
ignoreSSLErrors: boolean,
39+
allowSelfSigned: boolean,
4040
): Promise<string> {
4141
const version = getGGShieldVersion(context);
4242
console.log(`Latest GGShield version: ${version}`);
@@ -70,7 +70,7 @@ export async function getGGShield(
7070
arch,
7171
ggshieldFolder,
7272
version,
73-
ignoreSSLErrors,
73+
allowSelfSigned,
7474
);
7575
outputChannel.appendLine(
7676
`Updated to GGShield v${version}. Checkout https://github.com/GitGuardian/ggshield for more info.`,
@@ -134,7 +134,7 @@ export async function installGGShield(
134134
arch: string,
135135
ggshieldFolder: string,
136136
version: string,
137-
ignoreSSLErrors: boolean,
137+
allowSelfSigned: boolean,
138138
): Promise<void> {
139139
let extension: string = "";
140140
switch (platform) {
@@ -159,7 +159,7 @@ export async function installGGShield(
159159
fileName,
160160
downloadUrl,
161161
ggshieldFolder,
162-
ignoreSSLErrors,
162+
allowSelfSigned,
163163
);
164164
extractGGShieldBinary(path.join(ggshieldFolder, fileName), ggshieldFolder);
165165
}
@@ -197,14 +197,14 @@ async function downloadGGShieldFromGitHub(
197197
fileName: string,
198198
downloadUrl: string,
199199
ggshieldFolder: string,
200-
ignoreSSLErrors: boolean,
200+
allowSelfSigned: boolean,
201201
): Promise<void> {
202202
console.log(`Downloading GGShield from ${downloadUrl}`);
203203

204-
const instance = ignoreSSLErrors
204+
const instance = allowSelfSigned
205205
? new Agent({
206206
rejectUnauthorized: false,
207-
})
207+
})
208208
: undefined;
209209

210210
const { data } = await axios.get(downloadUrl, {

0 commit comments

Comments
 (0)