You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'KMS_SERVER_CA_CERT_PATH is required when TLS mode is MTLS',
247
273
);
248
274
});
275
+
276
+
it('should throw error when same certificate is used for server and client TLS',()=>{
277
+
process.env.KMS_URL='http://localhost:3000';
278
+
process.env.SERVER_TLS_KEY=mockTlsKey;
279
+
process.env.SERVER_TLS_CERT=mockTlsCert;
280
+
process.env.KMS_CLIENT_TLS_KEY=mockTlsKey;// Same as server key
281
+
process.env.KMS_CLIENT_TLS_CERT=mockTlsCert;// Same as server cert
282
+
process.env.KMS_SERVER_CA_CERT_PATH=path.resolve(
283
+
__dirname,
284
+
'mocks/certs/test-ssl-cert.pem',
285
+
);
286
+
(()=>initConfig()).should.throw(
287
+
'KMS_CLIENT_TLS_KEY_PATH and KMS_CLIENT_TLS_CERT_PATH (or KMS_CLIENT_TLS_KEY and KMS_CLIENT_TLS_CERT) are required for outbound mTLS connections to KMS. Client certificates cannot reuse server certificates for security reasons.',
it('should throw error when same certificate is used for server and client TLS in Master Express mode',()=>{
452
+
process.env.SERVER_TLS_KEY=mockTlsKey;
453
+
process.env.SERVER_TLS_CERT=mockTlsCert;
454
+
process.env.AWM_CLIENT_TLS_KEY=mockTlsKey;// Same as server key
455
+
process.env.AWM_CLIENT_TLS_CERT=mockTlsCert;// Same as server cert
456
+
(()=>initConfig()).should.throw(
457
+
'AWM_CLIENT_TLS_KEY_PATH and AWM_CLIENT_TLS_CERT_PATH (or AWM_CLIENT_TLS_KEY and AWM_CLIENT_TLS_CERT) are required for outbound mTLS connections to Advanced Wallet Manager. Client certificates cannot reuse server certificates for security reasons.',
'KMS_CLIENT_TLS_KEY_PATH and KMS_CLIENT_TLS_CERT_PATH (or KMS_CLIENT_TLS_KEY and KMS_CLIENT_TLS_CERT) are required for outbound mTLS connections to KMS. Client certificates cannot reuse server certificates for security reasons.',
237
+
);
238
+
}
236
239
}
237
240
238
241
// Validate that certificates are properly loaded when TLS is enabled
@@ -310,6 +313,8 @@ function masterExpressEnvConfig(): Partial<MasterExpressConfig> {
'AWM_CLIENT_TLS_KEY_PATH and AWM_CLIENT_TLS_CERT_PATH (or AWM_CLIENT_TLS_KEY and AWM_CLIENT_TLS_CERT) are required for outbound mTLS connections to Advanced Wallet Manager. Client certificates cannot reuse server certificates for security reasons.',
0 commit comments