Skip to content

Commit 3834d8d

Browse files
Fix CA certificate base64 decoding in DPT
1 parent 565620a commit 3834d8d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

internal/controller/tls_config.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package controller
1919
import (
2020
"crypto/tls"
2121
"crypto/x509"
22-
"encoding/base64"
2322
"fmt"
2423
"net/http"
2524

@@ -50,11 +49,8 @@ func buildTLSConfig(dpt *oadpv1alpha1.DataProtectionTest, bsl *velerov1.BackupSt
5049
if bsl != nil && bsl.ObjectStorage != nil && bsl.ObjectStorage.CACert != nil {
5150
logger.Info("Custom CA certificate found in BSL")
5251

53-
// Decode base64-encoded PEM certificate
54-
caCertPEM, err := base64.StdEncoding.DecodeString(string(bsl.ObjectStorage.CACert))
55-
if err != nil {
56-
return nil, fmt.Errorf("failed to decode CA certificate: %w", err)
57-
}
52+
// Use the PEM certificate directly (already decoded by Kubernetes)
53+
caCertPEM := bsl.ObjectStorage.CACert
5854

5955
// Create certificate pool with custom CA
6056
caCertPool := x509.NewCertPool()

0 commit comments

Comments
 (0)