This is an automated email from the ASF dual-hosted git repository.
sai_boorlagadda pushed a commit to branch release/1.9.0
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/release/1.9.0 by this push:
new e494a11 GEODE-2059 client SSL handshake attempts do not time out
e494a11 is described below
commit e494a110c959cc708add40c4414657a29af899a0
Author: Bruce Schuchardt <[email protected]>
AuthorDate: Mon Mar 4 11:39:32 2019 -0800
GEODE-2059 client SSL handshake attempts do not time out
Updating tests to allow an SSLException with cause
SocketTimeoutException.
(cherry picked from commit e77145bd7d55b72770ce041d5d859ae3333f432c)
---
.../geode/internal/net/SSLSocketIntegrationTest.java | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git
a/geode-core/src/integrationTest/java/org/apache/geode/internal/net/SSLSocketIntegrationTest.java
b/geode-core/src/integrationTest/java/org/apache/geode/internal/net/SSLSocketIntegrationTest.java
index 5e81b83..8e27671 100755
---
a/geode-core/src/integrationTest/java/org/apache/geode/internal/net/SSLSocketIntegrationTest.java
+++
b/geode-core/src/integrationTest/java/org/apache/geode/internal/net/SSLSocketIntegrationTest.java
@@ -53,6 +53,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLException;
import org.apache.commons.io.FileUtils;
import org.junit.After;
@@ -71,6 +72,7 @@ import
org.apache.geode.distributed.internal.DistributionConfigImpl;
import org.apache.geode.internal.ByteBufferOutputStream;
import org.apache.geode.internal.security.SecurableCommunicationChannel;
import org.apache.geode.internal.tcp.ByteBufferInputStream;
+import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.test.junit.categories.MembershipTest;
/**
@@ -112,6 +114,8 @@ public class SSLSocketIntegrationTest {
@Before
public void setUp() throws Exception {
+ IgnoredException.addIgnoredException("javax.net.ssl.SSLException: Read
timed out");
+
File keystore = findTestKeystore();
System.setProperty("javax.net.ssl.trustStore",
keystore.getCanonicalPath());
System.setProperty("javax.net.ssl.trustStorePassword", "password");
@@ -324,6 +328,10 @@ public class SSLSocketIntegrationTest {
socket.connect(new InetSocketAddress(localHost, serverPort));
await().untilAsserted(() -> assertFalse(serverThread.isAlive()));
assertNotNull(serverException);
+ if (serverException instanceof SSLException
+ && serverException.getCause() instanceof SocketTimeoutException) {
+ throw serverException.getCause();
+ }
throw serverException;
}
@@ -401,11 +409,15 @@ public class SSLSocketIntegrationTest {
System.err.println(
"client successfully connected to server but should not have
been able to do so");
return false;
- } catch (SocketTimeoutException e) {
+ } catch (SSLException | SocketTimeoutException e) {
+ IOException ioException = e;
// we need to verify that this timed out in the handshake
// code
+ if (e instanceof SSLException && e.getCause() instanceof
SocketTimeoutException) {
+ ioException = (SocketTimeoutException) ioException.getCause();
+ }
System.out.println("client connect attempt timed out - checking
stack trace");
- StackTraceElement[] trace = e.getStackTrace();
+ StackTraceElement[] trace = ioException.getStackTrace();
for (StackTraceElement element : trace) {
if (element.getMethodName().equals("configureClientSSLSocket")) {
System.out.println("client connect attempt timed out in the
appropriate method");