File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { Localized } from './localize';
7
7
import { raceCancellationError } from './async' ;
8
8
import { solveCertificateProblem } from './telemetry' ;
9
9
import { traceError } from './logging' ;
10
+ import { isSelfCertsError } from '../validator' ;
10
11
11
12
/**
12
13
* Responsible for intercepting connections to a remote server and asking for a password if necessary
@@ -27,7 +28,7 @@ export class SimpleFetch {
27
28
) ;
28
29
} catch ( e ) {
29
30
traceError ( `Error sending request to ${ url } ` , e ) ;
30
- if ( e . message . indexOf ( 'reason: self signed certificate' ) >= 0 ) {
31
+ if ( isSelfCertsError ( e ) ) {
31
32
// Ask user to change setting and possibly try again.
32
33
const value = await window . showErrorMessage (
33
34
Localized . jupyterSelfCertFail ( e . message ) ,
Original file line number Diff line number Diff line change @@ -356,7 +356,12 @@ function isUnableToGetIssuerCertError(err: Error) {
356
356
* The URI entry box when picking a server. It should ask the user if they want to allow it anyway.
357
357
*/
358
358
export function isSelfCertsError ( err : Error ) {
359
- return err . message . indexOf ( 'reason: self signed certificate' ) >= 0 || isUnableToGetIssuerCertError ( err ) ;
359
+ return (
360
+ err . message . indexOf ( 'reason: self signed certificate' ) >= 0 ||
361
+ err . message . indexOf ( "is not in the cert's list" ) >= 0 ||
362
+ err . message . indexOf ( 'reason: unable to verify the first certificate' ) >= 0 ||
363
+ isUnableToGetIssuerCertError ( err )
364
+ ) ;
360
365
}
361
366
362
367
export async function handleSelfCertsError ( message : string ) : Promise < boolean > {
You can’t perform that action at this time.
0 commit comments