Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-laterman committed Apr 26, 2024
1 parent 50fd956 commit 19c7d68
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion x-pack/elastic-agent/pkg/core/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"crypto/tls"
"crypto/x509"
"encoding/json"
stderr "errors"
"fmt"
"io"
"net"
Expand All @@ -26,6 +27,7 @@ import (
"github.com/elastic/elastic-agent-client/v7/pkg/client"
"github.com/elastic/elastic-agent-client/v7/pkg/proto"

"github.com/elastic/beats/v7/libbeat/common/transport/tlscommon"
"github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors"
"github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/authority"
"github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger"
Expand Down Expand Up @@ -153,6 +155,7 @@ func (s *Server) Start() error {
return errors.New("failed to append root CA", errors.TypeSecurity)
}
creds := credentials.NewTLS(&tls.Config{
MinVersion: tlscommon.TLSVersionDefaultMin,
ClientAuth: tls.RequireAndVerifyClientCert,
ClientCAs: certPool,
GetCertificate: s.getCertificate,
Expand Down Expand Up @@ -984,7 +987,7 @@ type actionResult struct {
}

func reportableErr(err error) bool {
if err == io.EOF {
if stderr.Is(err, io.EOF) {
return false
}
s, ok := status.FromError(err)
Expand Down

0 comments on commit 19c7d68

Please sign in to comment.