Skip to content

Commit

Permalink
fix linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachard committed Oct 30, 2023
1 parent 225def0 commit 80b917b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dnsutils/tls_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TlsClientConfig(options TlsOptions) (*tls.Config, error) {
CAs := x509.NewCertPool()
pemData, err := os.ReadFile(options.CAFile)
if err != nil {
return nil, fmt.Errorf("could not read CA certificate %q: %v", options.CAFile, err)
return nil, fmt.Errorf("could not read CA certificate %q: %w", options.CAFile, err)
}
if !CAs.AppendCertsFromPEM(pemData) {
return nil, fmt.Errorf("failed to append certificates from PEM file: %q", options.CAFile)
Expand All @@ -45,7 +45,7 @@ func TlsClientConfig(options TlsOptions) (*tls.Config, error) {
if len(options.CertFile) > 0 && len(options.KeyFile) > 0 {
cer, err := tls.LoadX509KeyPair(options.CertFile, options.KeyFile)
if err != nil {
return nil, fmt.Errorf("loading certificate failed: %s", err)
return nil, fmt.Errorf("loading certificate failed: %w", err)
}
tlsConfig.Certificates = []tls.Certificate{cer}
}
Expand Down

0 comments on commit 80b917b

Please sign in to comment.