Skip to content

Commit

Permalink
Merge pull request #3 from kyverno/rm-base64
Browse files Browse the repository at this point in the history
  • Loading branch information
vishal-chdhry authored Aug 24, 2023
2 parents c2aa3a0 + ba94c43 commit 24f8421
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions certmanager/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package certmanager
import (
"context"
"crypto/tls"
"encoding/base64"
"errors"
"time"

Expand Down Expand Up @@ -102,17 +101,7 @@ func (c *controller) GetCertificate(*tls.ClientHelloInfo) (*tls.Certificate, err
return nil, errors.New("secret is not a TLS secret")
}

tlscert, err := base64.StdEncoding.DecodeString(string(secret.Data[corev1.TLSCertKey]))
if err != nil {
return nil, err
}

tlskey, err := base64.StdEncoding.DecodeString(string(secret.Data[corev1.TLSPrivateKeyKey]))
if err != nil {
return nil, err
}

cert, err := tls.X509KeyPair(tlscert, tlskey)
cert, err := tls.X509KeyPair(secret.Data[corev1.TLSCertKey], secret.Data[corev1.TLSPrivateKeyKey])
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 24f8421

Please sign in to comment.