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

@@ -8,6 +8,7 @@ import (
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"errors"
"fmt"
"time"
@@ -52,6 +53,9 @@ func (r *rootCA) WithClientCert(config *client.ClientCertConfig) (client.ClientC
// Create a self-signed certificate.
func newRootCA(config *ca.CaConfig) ([]byte, []byte, error) {
if config == nil {
return nil, nil, errors.New("ca.CaConfig config is nil")
}
priv, err := newPrivateKey()
if err != nil {
return nil, nil, fmt.Errorf("newPrivateKey: %s", err)