@@ -257,8 +257,8 @@ export async function addCertToSystemTrustStoreAndSaveCert(cert: Cert, caCert: s
257
257
258
258
export function storeCertificate ( cert : Cert , options ?: TlsOption ) : CertPath {
259
259
debugLog ( 'storage' , `Storing certificate and private key with options: ${ JSON . stringify ( options ) } ` , options ?. verbose )
260
- const certPath = options ?. certPath || config . certPath
261
- const certKeyPath = options ?. keyPath || config . keyPath
260
+ const certPath = options ?. basePath ? path . join ( options . basePath , options ?. certPath || config . certPath ) : config . certPath
261
+ const certKeyPath = options ?. basePath ? path . join ( options . basePath , options ?. keyPath || config . keyPath ) : config . keyPath
262
262
263
263
debugLog ( 'storage' , `Certificate path: ${ certPath } ` , options ?. verbose )
264
264
debugLog ( 'storage' , `Private key path: ${ certKeyPath } ` , options ?. verbose )
@@ -295,7 +295,7 @@ export function storeCertificate(cert: Cert, options?: TlsOption): CertPath {
295
295
*/
296
296
export function storeCACertificate ( caCert : string , options ?: TlsOption ) : CertPath {
297
297
debugLog ( 'storage' , 'Storing CA certificate' , options ?. verbose )
298
- const caCertPath = options ?. caCertPath || config . caCertPath
298
+ const caCertPath = options ?. basePath ? path . join ( options . basePath , options ?. caCertPath || config . caCertPath ) : config . caCertPath
299
299
300
300
debugLog ( 'storage' , `CA certificate path: ${ caCertPath } ` , options ?. verbose )
301
301
0 commit comments