fix: enhance logging during certificate conversion and improve PFX buffer handling

This commit is contained in:
2026-05-22 14:29:46 +02:00
parent eb7a109c71
commit e484b465e8
+3 -1
View File
@@ -157,7 +157,9 @@ export class Provisioner {
if (currentFormat === 'pem') { if (currentFormat === 'pem') {
const bundle = parsePemBundle(secretValue); const bundle = parsePemBundle(secretValue);
this.log(`[convert] parsed blocks — key: ${bundle.privateKeyPem.length} chars, cert: ${bundle.certPem.length} chars, chain: ${bundle.chainPem.length} chars`); this.log(`[convert] parsed blocks — key: ${bundle.privateKeyPem.length} chars, cert: ${bundle.certPem.length} chars, chain: ${bundle.chainPem.length} chars`);
await this.store.importCertificate(certName, pemToPfx(bundle.privateKeyPem, bundle.certPem, bundle.chainPem), 'pfx'); const pfxBuffer = pemToPfx(bundle.privateKeyPem, bundle.certPem, bundle.chainPem);
this.log(`[convert] PFX buffer size: ${pfxBuffer.length} bytes`);
await this.store.importCertificate(certName, pfxBuffer, 'pfx');
} else { } else {
const bundle = pfxToPem(Buffer.from(secretValue, 'base64')); const bundle = pfxToPem(Buffer.from(secretValue, 'base64'));
this.log(`[convert] parsed PFX — key: ${bundle.privateKeyPem.length} chars, cert: ${bundle.certPem.length} chars, chain: ${bundle.chainPem.length} chars`); this.log(`[convert] parsed PFX — key: ${bundle.privateKeyPem.length} chars, cert: ${bundle.certPem.length} chars, chain: ${bundle.chainPem.length} chars`);