mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-29 12:16:16 +08:00
Error if we are unable to marshal the ECDSA private key
This commit is contained in:
parent
0890e330e2
commit
aba3d37c88
|
@ -105,7 +105,12 @@ func PrivateKeyBytes(key crypto.PrivateKey) []byte {
|
|||
case *rsa.PrivateKey:
|
||||
keyBytes = x509.MarshalPKCS1PrivateKey(key)
|
||||
case *ecdsa.PrivateKey:
|
||||
keyBytes, _ = x509.MarshalECPrivateKey(key)
|
||||
var err error
|
||||
var t *testing.T
|
||||
keyBytes, err = x509.MarshalECPrivateKey(key)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
return keyBytes
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user