@@ -103,6 +103,7 @@ function advancedWalletManagerEnvConfig(): Partial<AdvancedWalletManagerConfig>
103103 // KMS settings
104104 kmsUrl,
105105 kmsTlsCertPath : readEnvVar ( 'KMS_TLS_CERT_PATH' ) ,
106+ kmsAllowSelfSigned : readEnvVar ( 'KMS_ALLOW_SELF_SIGNED' ) === 'true' ,
106107 // mTLS settings
107108 keyPath : readEnvVar ( 'TLS_KEY_PATH' ) ,
108109 crtPath : readEnvVar ( 'TLS_CERT_PATH' ) ,
@@ -137,6 +138,8 @@ function mergeAkmConfigs(
137138 headersTimeout : get ( 'headersTimeout' ) ,
138139 kmsUrl : get ( 'kmsUrl' ) ,
139140 kmsTlsCertPath : get ( 'kmsTlsCertPath' ) ,
141+ kmsTlsCert : get ( 'kmsTlsCert' ) ,
142+ kmsAllowSelfSigned : get ( 'kmsAllowSelfSigned' ) ,
140143 keyPath : get ( 'keyPath' ) ,
141144 crtPath : get ( 'crtPath' ) ,
142145 tlsKey : get ( 'tlsKey' ) ,
@@ -230,6 +233,8 @@ function determineProtocol(url: string, tlsMode: TlsMode, isBitGo = false): stri
230233function masterExpressEnvConfig ( ) : Partial < MasterExpressConfig > {
231234 const advancedWalletManagerUrl = readEnvVar ( 'ADVANCED_WALLET_MANAGER_URL' ) ;
232235 const advancedWalletManagerCert = readEnvVar ( 'ADVANCED_WALLET_MANAGER_CERT' ) ;
236+ const advancedWalletManagerAllowSelfSigned =
237+ readEnvVar ( 'ADVANCED_WALLET_MANAGER_ALLOW_SELF_SIGNED' ) === 'true' ;
233238 const tlsMode = determineTlsMode ( ) ;
234239
235240 if ( ! advancedWalletManagerUrl ) {
@@ -262,6 +267,7 @@ function masterExpressEnvConfig(): Partial<MasterExpressConfig> {
262267 authVersion : Number ( readEnvVar ( 'BITGO_AUTH_VERSION' ) ) ,
263268 advancedWalletManagerUrl : advancedWalletManagerUrl ,
264269 advancedWalletManagerCert : advancedWalletManagerCert ,
270+ advancedWalletManagerAllowSelfSigned,
265271 customBitcoinNetwork : readEnvVar ( 'BITGO_CUSTOM_BITCOIN_NETWORK' ) ,
266272 // mTLS settings
267273 keyPath : readEnvVar ( 'TLS_KEY_PATH' ) ,
@@ -301,6 +307,7 @@ function mergeMasterExpressConfigs(
301307 authVersion : get ( 'authVersion' ) ,
302308 advancedWalletManagerUrl : get ( 'advancedWalletManagerUrl' ) ,
303309 advancedWalletManagerCert : get ( 'advancedWalletManagerCert' ) ,
310+ advancedWalletManagerAllowSelfSigned : get ( 'advancedWalletManagerAllowSelfSigned' ) ,
304311 customBitcoinNetwork : get ( 'customBitcoinNetwork' ) ,
305312 keyPath : get ( 'keyPath' ) ,
306313 crtPath : get ( 'crtPath' ) ,
@@ -371,7 +378,7 @@ export function configureMasterExpressMode(): MasterExpressConfig {
371378 advancedWalletManagerCert : fs . readFileSync ( config . advancedWalletManagerCert , 'utf-8' ) ,
372379 } ;
373380 logger . info (
374- `Successfully loaded Advanced Wallet Manager certificate from file: ${ config . advancedWalletManagerCert . substring (
381+ `Successfully loaded Advanced Wallet Manager certificate from file: ${ config . advancedWalletManagerCert ? .substring (
375382 0 ,
376383 50 ,
377384 ) } ...`,
0 commit comments