File tree Expand file tree Collapse file tree
src/vs/workbench/services/extensions/node Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -488,15 +488,29 @@ async function readMacCaCertificates() {
488488 } ;
489489}
490490
491+ const linuxCaCertificatePaths = [
492+ '/etc/ssl/certs/ca-certificates.crt' ,
493+ '/etc/ssl/certs/ca-bundle.crt' ,
494+ ] ;
495+
491496async function readLinuxCaCertificates ( ) {
492- const content = await promisify ( fs . readFile ) ( '/etc/ssl/certs/ca-certificates.crt' , { encoding : 'utf8' } ) ;
493- const seen = { } ;
494- const certs = content . split ( / (? = - - - - - B E G I N C E R T I F I C A T E - - - - - ) / g)
495- . filter ( pem => ! ! pem . length && ! seen [ pem ] && ( seen [ pem ] = true ) ) ;
496- return {
497- certs,
498- append : false
499- } ;
497+ for ( const certPath of linuxCaCertificatePaths ) {
498+ try {
499+ const content = await promisify ( fs . readFile ) ( certPath , { encoding : 'utf8' } ) ;
500+ const seen = { } ;
501+ const certs = content . split ( / (? = - - - - - B E G I N C E R T I F I C A T E - - - - - ) / g)
502+ . filter ( pem => ! ! pem . length && ! seen [ pem ] && ( seen [ pem ] = true ) ) ;
503+ return {
504+ certs,
505+ append : false
506+ } ;
507+ } catch ( err ) {
508+ if ( err . code !== 'ENOENT' ) {
509+ throw err ;
510+ }
511+ }
512+ }
513+ return undefined ;
500514}
501515
502516function derToPem ( blob ) {
You can’t perform that action at this time.
0 commit comments