diff --git a/extensions/eclipse-che-theia-remote-impl-che-server/src/node/che-server-certificate-service-impl.ts b/extensions/eclipse-che-theia-remote-impl-che-server/src/node/che-server-certificate-service-impl.ts index d68b84f96..7cce9ff1a 100644 --- a/extensions/eclipse-che-theia-remote-impl-che-server/src/node/che-server-certificate-service-impl.ts +++ b/extensions/eclipse-che-theia-remote-impl-che-server/src/node/che-server-certificate-service-impl.ts @@ -31,8 +31,10 @@ export class CheServerCertificateServiceImpl implements CertificateService { const publicCertificates = await fs.readdir(PUBLIC_CRT_PATH); for (const publicCertificate of publicCertificates) { const certPath = path.join(PUBLIC_CRT_PATH, publicCertificate); - const content = await fs.readFile(certPath); - certificateAuthority.push(content); + if ((await fs.pathExists(certPath)) && (await fs.stat(certPath)).isFile()) { + const content = await fs.readFile(certPath); + certificateAuthority.push(content); + } } } diff --git a/extensions/eclipse-che-theia-remote-impl-k8s/src/node/k8s-certificate-service-impl.ts b/extensions/eclipse-che-theia-remote-impl-k8s/src/node/k8s-certificate-service-impl.ts index b3e61d709..03b1835b4 100644 --- a/extensions/eclipse-che-theia-remote-impl-k8s/src/node/k8s-certificate-service-impl.ts +++ b/extensions/eclipse-che-theia-remote-impl-k8s/src/node/k8s-certificate-service-impl.ts @@ -31,8 +31,10 @@ export class K8sCertificateServiceImpl implements CertificateService { const publicCertificates = await fs.readdir(PUBLIC_CRT_PATH); for (const publicCertificate of publicCertificates) { const certPath = path.join(PUBLIC_CRT_PATH, publicCertificate); - const content = await fs.readFile(certPath); - certificateAuthority.push(content); + if ((await fs.pathExists(certPath)) && (await fs.stat(certPath)).isFile()) { + const content = await fs.readFile(certPath); + certificateAuthority.push(content); + } } }