Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-laterman committed Jan 16, 2024
1 parent ae43376 commit a3776f6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions x-pack/filebeat/input/lumberjack/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ func TestServer(t *testing.T) {
c := makeTestConfig()
c.TLS = serverConf
// Disable mTLS requirements in the server.
c.TLS.ClientAuth = 0 // tls.NoClientCert
var clientAuth = tlscommon.TLSClientAuthNone
c.TLS.ClientAuth = &clientAuth
c.TLS.VerificationMode = tlscommon.VerifyNone

testSendReceive(t, c, 10, clientConf)
Expand Down Expand Up @@ -220,11 +221,13 @@ func tlsSetup(t *testing.T) (clientConfig *tls.Config, serverConfig *tlscommon.S
MinVersion: tls.VersionTLS12,
}

var clientAuth = tlscommon.ClientAuthRequire

serverConfig = &tlscommon.ServerConfig{
// NOTE: VerifyCertificate is ineffective unless ClientAuth is set to RequireAndVerifyClientCert.
VerificationMode: tlscommon.VerifyCertificate,
// Unfortunately ServerConfig uses an unexported type in an exported field.
ClientAuth: 4, // tls.RequireAndVerifyClientCert
ClientAuth: &clientAuth, // tls.RequireAndVerifyClientCert
CAs: []string{
string(certData.ca.CertPEM(t)),
},
Expand Down

0 comments on commit a3776f6

Please sign in to comment.