Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Vargas <[email protected]>
  • Loading branch information
rubenvp8510 committed Jul 19, 2024
1 parent bcfd8c4 commit 3d7557c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions crypto/tls/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ func (cfg *ClientConfig) GetTLSCipherSuitesLongDescription() string {
return text
}

func (cfg *ClientConfig) validateCertificatePaths() (error, bool) {
func (cfg *ClientConfig) validateCertificatePaths() (bool, error) {
if cfg.CertPath != "" || cfg.KeyPath != "" {
if cfg.CertPath == "" {
return errCertMissing, true
return true, errCertMissing
}
if cfg.KeyPath == "" {
return errKeyMissing, true
return true, errKeyMissing
}
return nil, true
return true, nil
}
return nil, false
return false, nil
}

// GetTLSConfig initialises tls.Config from config options
Expand Down Expand Up @@ -124,7 +124,7 @@ func (cfg *ClientConfig) GetTLSConfig() (*tls.Config, error) {

loadCert := func() (*tls.Certificate, error) {
// not used boolean, assumed if this is called is because we already configured TLS Client certificates.
err, _ := cfg.validateCertificatePaths()
_, err := cfg.validateCertificatePaths()
if err == nil {
cert, err := reader.ReadSecret(cfg.CertPath)
if err != nil {
Expand All @@ -144,7 +144,7 @@ func (cfg *ClientConfig) GetTLSConfig() (*tls.Config, error) {
return nil, err
}

err, useClientCerts := cfg.validateCertificatePaths()
useClientCerts, err := cfg.validateCertificatePaths()
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 3d7557c

Please sign in to comment.