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

Commit

Permalink
Add CA certificates from all bundles from /public-certs directory (#1038
Browse files Browse the repository at this point in the history
)

Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
  • Loading branch information
mmorhun authored Mar 18, 2021
1 parent abb6768 commit d059cdf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
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

0 comments on commit d059cdf

Please sign in to comment.