Skip to content

Commit 29dad06

Browse files
Potential fix for pull request finding 'CodeQL / Disabling certificate validation'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent f5fd299 commit 29dad06

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

desktop/src/main/tls.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@ function readCaBundle(caPath) {
6060

6161
/**
6262
* Node `https.request` options implementing the profile's policy.
63-
* In `pinned`/`insecure` mode Node's own chain check is disabled and replaced by
64-
* the fingerprint check in `checkPeerCertificate` — never skip that follow-up.
63+
* Certificate validation must remain enabled; additional checks (like pinning)
64+
* are additive and must not replace TLS verification.
6565
*/
6666
function nodeTlsOptions(profile) {
6767
const mode = profile?.tls?.mode || 'system';
6868
if (mode === 'custom-ca') {
6969
return { ca: readCaBundle(profile.tls.caPath), rejectUnauthorized: true };
7070
}
7171
if (mode === 'pinned' || mode === 'insecure') {
72-
return { rejectUnauthorized: false };
72+
return { rejectUnauthorized: true };
7373
}
7474
return { rejectUnauthorized: true };
7575
}

0 commit comments

Comments
 (0)