mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
fix: PKCS8 format private key validating issue #326
This commit is contained in:
parent
1577eb184d
commit
979a1d5326
1 changed files with 6 additions and 1 deletions
|
@ -27,7 +27,12 @@ func IsPrivateKey(pemStr string) bool {
|
|||
}
|
||||
|
||||
_, errECDSA := x509.ParseECPrivateKey(block.Bytes)
|
||||
return errECDSA == nil
|
||||
if errECDSA == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
_, errPKC := x509.ParsePKCS8PrivateKey(block.Bytes)
|
||||
return errPKC == nil
|
||||
}
|
||||
|
||||
// IsCertificatePath checks if the file at the given path is a certificate or not exists.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue