Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
belimawr committed Jan 17, 2024
1 parent c0d1afb commit c8320bd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 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
clientAuth := tlscommon.TLSClientAuthNone
c.TLS.ClientAuth = &clientAuth // tls.NoClientCert
c.TLS.VerificationMode = tlscommon.VerifyNone

testSendReceive(t, c, 10, clientConf)
Expand Down Expand Up @@ -219,12 +220,12 @@ func tlsSetup(t *testing.T) (clientConfig *tls.Config, serverConfig *tlscommon.S
Certificates: []tls.Certificate{certData.client.TLSCertificate(t)},
MinVersion: tls.VersionTLS12,
}

clientAuth := tlscommon.TLSClientAuthRequired
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 c8320bd

Please sign in to comment.