From d0f6d273d006080284f635e1f10bec0311cb9fe3 Mon Sep 17 00:00:00 2001 From: Tim Vernum Date: Wed, 31 Jan 2018 18:26:57 +1100 Subject: [PATCH] [TEST] Add additional logging to test Attempt to diagnose elastic/x-pack-elasticsearch#3292 if it occurs again. Original commit: elastic/x-pack-elasticsearch@eb262540f053b45b2f895a04d278592e5eb736b4 --- .../elasticsearch/xpack/ssl/SSLTrustRestrictionsTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLTrustRestrictionsTests.java b/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLTrustRestrictionsTests.java index 7ec509a8ac2..4e76e59e596 100644 --- a/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLTrustRestrictionsTests.java +++ b/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLTrustRestrictionsTests.java @@ -5,6 +5,7 @@ */ package org.elasticsearch.xpack.ssl; +import org.apache.logging.log4j.message.ParameterizedMessage; import org.bouncycastle.asn1.x509.GeneralNames; import org.bouncycastle.openssl.jcajce.JcaPEMWriter; import org.elasticsearch.ElasticsearchException; @@ -26,7 +27,6 @@ import javax.net.ssl.SSLHandshakeException; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import javax.security.auth.x500.X500Principal; - import java.io.BufferedWriter; import java.io.IOException; import java.net.SocketException; @@ -147,6 +147,8 @@ public class SSLTrustRestrictionsTests extends SecurityIntegTestCase { try { tryConnect(trustedCert); } catch (SSLHandshakeException | SocketException ex) { + logger.warn(new ParameterizedMessage("unexpected handshake failure with certificate [{}] [{}]", + trustedCert.certificate.getSubjectDN(), trustedCert.certificate.getSubjectAlternativeNames()), ex); fail("handshake should have been successful, but failed with " + ex); } }