feat: add more tests to increase coverage

This commit is contained in:
2023-03-03 22:44:57 +01:00
parent ef2112534c
commit bb9df2fe8d
4 changed files with 52 additions and 8 deletions

View File

@@ -6,6 +6,7 @@ import (
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"errors"
"fmt"
"time"
@@ -44,6 +45,10 @@ func newClientCert(config *client.ClientCertConfig, rootCA *x509.Certificate, ro
}
block, _ := pem.Decode(rootKeyPEM)
if block == nil {
return nil, nil, errors.New("pem.Decode")
}
caPrivKey, err := x509.ParsePKCS8PrivateKey(block.Bytes)
if err != nil {
return nil, nil, fmt.Errorf("x509.ParsePKCS8PrivateKey: %s", err)