mirror of
https://github.com/rancher/rke.git
synced 2025-08-18 23:07:24 +00:00
Merge pull request #2545 from alexander-hughes/custom_certdir_fix
Update cert filename validation to *.pem
This commit is contained in:
commit
ad0b399a90
@ -592,7 +592,7 @@ func ReadCertsAndKeysFromDir(certDir string) (map[string]CertificatePKI, error)
|
|||||||
|
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
logrus.Debugf("[certificates] reading file %s from directory [%s]", file.Name(), certDir)
|
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
|
// fetching cert
|
||||||
cert, err := getCertFromFile(certDir, file.Name())
|
cert, err := getCertFromFile(certDir, file.Name())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user