Skip to content

Commit 55bb83c

Browse files
authored
chore: proxy log (#725)
## Problem ## Solution <!--- REMINDER: - Read CONTRIBUTING.md first. - Add test coverage for your changes. - Link to related issues/commits. - Testing: how did you test your changes? - Screenshots if applicable --> ## License By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent e467373 commit 55bb83c

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

runtimes/runtimes/util/standalone/experimentalProxyUtil.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,14 @@ export class ProxyConfigManager {
116116
getCertificates(): string[] {
117117
// Preserve NodeJS default certificates
118118
const certificates = [...tls.rootCertificates]
119+
let logstr = '[SSL Certificates]\n'
119120

120121
try {
121122
const certs = this.readSystemCertificates()
122123
if (certs) {
123124
certificates.push(...certs)
124125
}
126+
logstr += `- System root certificates length=${certs.length}`
125127
} catch (error: any) {
126128
OperationalTelemetryProvider.getTelemetryForScope(TELEMETRY_SCOPES.RUNTIMES).emitEvent({
127129
errorOrigin: 'caughtError',
@@ -135,18 +137,26 @@ export class ProxyConfigManager {
135137

136138
if (process.env.AWS_CA_BUNDLE) {
137139
const cert = this.readCertificateFile(process.env.AWS_CA_BUNDLE)
138-
cert && certificates.push(cert)
140+
if (cert) {
141+
certificates.push(cert)
142+
logstr += `- AWS_CA_BUNDLE=${cert}`
143+
}
139144
}
140145

141146
if (process.env.NODE_EXTRA_CA_CERTS) {
142147
const cert = this.readCertificateFile(process.env.NODE_EXTRA_CA_CERTS)
143-
cert && certificates.push(cert)
148+
if (cert) {
149+
certificates.push(cert)
150+
logstr += `- NODE_EXTRA_CA_CERTS=${cert}`
151+
}
144152
}
145153

146-
console.debug(`Total certificates read: ${certificates.length}`)
147154
const validCerts = this.removeExpiredCertificates(certificates)
155+
logstr += `- Total certificates loaded=${certificates.length}`
156+
logstr += `- Valid (non-expired) cert length=${validCerts.length}`
157+
158+
console.debug(logstr)
148159

149-
console.debug(`Using certificates: ${validCerts.length}`)
150160
return validCerts
151161
}
152162

0 commit comments

Comments
 (0)