(
caBundlePath: string[] | string,
)
| 86 | } |
| 87 | |
| 88 | async getAllCachedCustomCerts( |
| 89 | caBundlePath: string[] | string, |
| 90 | ): Promise<string[]> { |
| 91 | const paths = Array.isArray(caBundlePath) ? caBundlePath : [caBundlePath]; |
| 92 | const certs: string[] = []; |
| 93 | await Promise.all( |
| 94 | paths.map(async (path) => { |
| 95 | try { |
| 96 | const certContent = await this.getCachedCustomCert(path); |
| 97 | if (certContent) { |
| 98 | certs.push(certContent); |
| 99 | } else if (process.env.VERBOSE_FETCH) { |
| 100 | console.warn(`Empty certificate found at ${path}`); |
| 101 | } |
| 102 | } catch (error) { |
| 103 | if (process.env.VERBOSE_FETCH) { |
| 104 | console.error( |
| 105 | `Error loading custom certificate from ${path}:`, |
| 106 | error, |
| 107 | ); |
| 108 | } |
| 109 | } |
| 110 | }), |
| 111 | ); |
| 112 | return certs; |
| 113 | } |
| 114 | |
| 115 | async getCa(caBundlePath: undefined | string | string[]): Promise<string[]> { |
| 116 | if (!caBundlePath) { |
no test coverage detected