@@ -116,15 +116,14 @@ export class ProxyConfigManager {
116116 getCertificates ( ) : string [ ] {
117117 // Preserve NodeJS default certificates
118118 const certificates = [ ...tls . rootCertificates ]
119- const systemCertCount = certificates . length
120- let awsCaBundleCount = 0
121- let nodeExtraCertsCount = 0
119+ let logstr = '[SSL Certificates]\n'
122120
123121 try {
124122 const certs = this . readSystemCertificates ( )
125123 if ( certs ) {
126124 certificates . push ( ...certs )
127125 }
126+ logstr += `- System root certificates length=${ certs . length } `
128127 } catch ( error : any ) {
129128 OperationalTelemetryProvider . getTelemetryForScope ( TELEMETRY_SCOPES . RUNTIMES ) . emitEvent ( {
130129 errorOrigin : 'caughtError' ,
@@ -136,34 +135,27 @@ export class ProxyConfigManager {
136135 console . warn ( 'Failed to read system certificates:' , error )
137136 }
138137
139- const beforeAwsBundle = certificates . length
140138 if ( process . env . AWS_CA_BUNDLE ) {
141139 const cert = this . readCertificateFile ( process . env . AWS_CA_BUNDLE )
142140 if ( cert ) {
143141 certificates . push ( cert )
144- awsCaBundleCount = certificates . length - beforeAwsBundle
142+ logstr += `- AWS_CA_BUNDLE= ${ cert } `
145143 }
146144 }
147145
148- const beforeNodeExtra = certificates . length
149146 if ( process . env . NODE_EXTRA_CA_CERTS ) {
150147 const cert = this . readCertificateFile ( process . env . NODE_EXTRA_CA_CERTS )
151148 if ( cert ) {
152149 certificates . push ( cert )
153- nodeExtraCertsCount = certificates . length - beforeNodeExtra
150+ logstr += `- NODE_EXTRA_CA_CERTS= ${ cert } `
154151 }
155152 }
156153
157154 const validCerts = this . removeExpiredCertificates ( certificates )
155+ logstr += `- Total certificates loaded=${ certificates . length } `
156+ logstr += `- Valid (non-expired) cert length=${ validCerts . length } `
158157
159- console . debug (
160- `[SSL Certificates]\n` +
161- ` System root certificates: ${ systemCertCount } \n` +
162- ` AWS_CA_BUNDLE: ${ awsCaBundleCount } \n` +
163- ` NODE_EXTRA_CA_CERTS: ${ nodeExtraCertsCount } \n` +
164- ` Total loaded: ${ certificates . length } \n` +
165- ` Valid (non-expired): ${ validCerts . length } `
166- )
158+ console . debug ( logstr )
167159
168160 return validCerts
169161 }
0 commit comments