Skip to content

Commit 4efd36f

Browse files
authored
Fix identification of self signed certs (#17049)
1 parent b67ca34 commit 4efd36f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/platform/errors/jupyterSelfCertsError.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,19 @@ export class JupyterSelfCertsError extends BaseError {
1818
}
1919
public static isSelfCertsError(err: unknown) {
2020
const message = (err as undefined | { message: string })?.message ?? '';
21+
const name = (err as undefined | { name: string })?.name ?? '';
22+
const messageToCheck = `${name} ${message}`;
2123
return (
22-
message.indexOf('reason: self signed certificate') >= 0 ||
24+
messageToCheck.indexOf('reason: self signed certificate') >= 0 ||
2325
// https://github.com/microsoft/vscode-jupyter-hub/issues/36#issuecomment-1854097594
24-
message.indexOf('reason: unable to verify the first certificate') >= 0 ||
26+
messageToCheck.indexOf('reason: unable to verify the first certificate') >= 0 ||
2527
// https://github.com/microsoft/vscode-jupyter-hub/issues/36#issuecomment-1761234981
26-
message.indexOf('reason: unable to get issuer certificate') >= 0 ||
28+
messageToCheck.indexOf('reason: unable to get issuer certificate') >= 0 ||
2729
// https://github.com/microsoft/vscode-jupyter/issues/7558#issuecomment-993054968
28-
message.indexOf("is not in the cert's list") >= 0
30+
messageToCheck.indexOf("is not in the cert's list") >= 0 ||
31+
// https://github.com/microsoft/vscode-jupyter/issues/16522
32+
messageToCheck.indexOf('unable to verify the first certificate') >= 0 ||
33+
messageToCheck.indexOf('UNABLE_TO_GET_ISSUER_CERT') >= 0
2934
);
3035
}
3136
}

0 commit comments

Comments
 (0)