@@ -95,9 +95,9 @@ describe('DBSQLClient.connect', () => {
9595 const connectionOptions = client [ 'getConnectionOptions' ] ( { ...connectOptions , customCaCert } ) ;
9696
9797 expect ( connectionOptions . ca ) . to . be . an ( 'array' ) ;
98- const ca = connectionOptions . ca as Array < string > ;
99- // The custom cert must be present...
100- expect ( ca ) . to . include ( customCaCert ) ;
98+ const ca = connectionOptions . ca as Array < Buffer | string > ;
99+ // The custom cert must be present, pushed as a Buffer (byte-fidelity, parity with cert/key) ...
100+ expect ( ca . map ( ( entry ) => entry . toString ( 'utf8' ) ) ) . to . include ( customCaCert ) ;
101101 // ...alongside the built-in system roots (so public warehouses still validate).
102102 expect ( ca . length ) . to . be . greaterThan ( 1 ) ;
103103 } ) ;
@@ -113,11 +113,13 @@ describe('DBSQLClient.connect', () => {
113113 try {
114114 const connectionOptions = client [ 'getConnectionOptions' ] ( { ...connectOptions , customCaCert } ) ;
115115
116- const ca = connectionOptions . ca as Array < string > ;
117- expect ( ca ) . to . include ( customCaCert ) ;
116+ const ca = connectionOptions . ca as Array < Buffer | string > ;
117+ const caStrings = ca . map ( ( entry ) => entry . toString ( 'utf8' ) ) ;
118+ // The custom cert is pushed as a Buffer (byte-fidelity, parity with cert/key).
119+ expect ( caStrings ) . to . include ( customCaCert ) ;
118120 // Roots injected via NODE_EXTRA_CA_CERTS must survive the additive rebuild,
119121 // otherwise callers relying on that env var lose their trust anchors.
120- expect ( ca ) . to . include ( extraCaCert ) ;
122+ expect ( caStrings ) . to . include ( extraCaCert ) ;
121123 } finally {
122124 readFileSync . restore ( ) ;
123125 if ( previousEnv === undefined ) {
0 commit comments