Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Add CA certificates from all bundles from /public-certs directory #1038

Merged
merged 1 commit into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ export class CheServerCertificateServiceImpl implements CertificateService {
if (existsPublicCrt) {
const publicCertificates = await fs.readdir(PUBLIC_CRT_PATH);
for (const publicCertificate of publicCertificates) {
if (publicCertificate.endsWith('.crt')) {
const certPath = path.join(PUBLIC_CRT_PATH, publicCertificate);
const content = await fs.readFile(certPath);
certificateAuthority.push(content);
}
const certPath = path.join(PUBLIC_CRT_PATH, publicCertificate);
const content = await fs.readFile(certPath);
certificateAuthority.push(content);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ export class K8sCertificateServiceImpl implements CertificateService {
if (existsPublicCrt) {
const publicCertificates = await fs.readdir(PUBLIC_CRT_PATH);
for (const publicCertificate of publicCertificates) {
if (publicCertificate.endsWith('.crt')) {
const certPath = path.join(PUBLIC_CRT_PATH, publicCertificate);
const content = await fs.readFile(certPath);
certificateAuthority.push(content);
}
const certPath = path.join(PUBLIC_CRT_PATH, publicCertificate);
const content = await fs.readFile(certPath);
certificateAuthority.push(content);
}
}

Expand Down
6 changes: 2 additions & 4 deletions plugins/workspace-plugin/src/ca-cert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ export const getCertificate = new Promise<string | undefined>(async resolve => {
if (await fs.pathExists(PUBLIC_CRT_PATH)) {
const publicCertificates = await fs.readdir(PUBLIC_CRT_PATH);
for (const publicCertificate of publicCertificates) {
if (publicCertificate.endsWith('.crt')) {
const certPath = path.join(PUBLIC_CRT_PATH, publicCertificate);
certificates.push(await fs.readFile(certPath));
}
const certPath = path.join(PUBLIC_CRT_PATH, publicCertificate);
certificates.push(await fs.readFile(certPath));
}
}

Expand Down