Skip to content
Snippets Groups Projects
Unverified Commit 3366ce5f authored by Massimiliano Adamo's avatar Massimiliano Adamo
Browse files

try to reduce code smell

parent 3a3a34d8
No related branches found
No related tags found
No related merge requests found
Pipeline #1058 passed
......@@ -134,7 +134,7 @@ func checkCertificates(dnsname string, certificate string, fullchain string, ca
fullchainBlock, _ := pem.Decode([]byte(certFullchainPEM))
if fullchainBlock == nil {
if fail == true {
fmt.Printf("%v failed to parse certificate PEM\n", errMsg)
fmt.Printf("%v failed to parse full chain PEM\n", errMsg)
appExit(255)
} else {
return false
......@@ -143,7 +143,7 @@ func checkCertificates(dnsname string, certificate string, fullchain string, ca
fullchainCert, fullchainErr := x509.ParseCertificate(fullchainBlock.Bytes)
if fullchainErr != nil {
if fail == true {
fmt.Printf("%v failed to parse certificate %v\n", errMsg, fullchainErr)
fmt.Printf("%v failed to parse full chain %v\n", errMsg, fullchainErr)
appExit(255)
} else {
return false
......@@ -167,7 +167,7 @@ func checkCertificates(dnsname string, certificate string, fullchain string, ca
}
if _, fullchainErr := fullchainCert.Verify(opts); fullchainErr != nil {
if fail == true {
fmt.Printf("%v failed to parse certificate %v\n", errMsg, err.Error())
fmt.Printf("%v failed to parse full chain %v\n", errMsg, err.Error())
} else {
return false
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment