mirror of
https://github.com/rancher/rke.git
synced 2025-04-27 19:25:44 +00:00
Update cert filename validation to *.pem
Users leveraging custom certs directories face errors when deploying if the directory contains any files that do not end in .pem. This change adds additional validation to ensure files are *.pem before attempting further logic. Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
This commit is contained in:
parent
462a7ba01e
commit
9381a255bf
@ -592,7 +592,7 @@ func ReadCertsAndKeysFromDir(certDir string) (map[string]CertificatePKI, error)
|
||||
|
||||
for _, file := range files {
|
||||
logrus.Debugf("[certificates] reading file %s from directory [%s]", file.Name(), certDir)
|
||||
if !strings.HasSuffix(file.Name(), "-key.pem") && !strings.HasSuffix(file.Name(), "-csr.pem") {
|
||||
if strings.HasSuffix(file.Name(), ".pem") && !strings.HasSuffix(file.Name(), "-key.pem") && !strings.HasSuffix(file.Name(), "-csr.pem") {
|
||||
// fetching cert
|
||||
cert, err := getCertFromFile(certDir, file.Name())
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user