geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [geode] branch develop updated: GEODE-3563 SSL socket handling problems in TCPConduit run
Date Tue, 22 May 2018 15:48:57 GMT
This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new d998510  GEODE-3563 SSL socket handling problems in TCPConduit run
d998510 is described below

commit d998510ae479f3d8a0a1950c8a6b363a480459c8
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
AuthorDate: Tue May 22 08:46:15 2018 -0700

    GEODE-3563 SSL socket handling problems in TCPConduit run
    
    Gester suggested adding a unit test for non-ssl sockets to verify that
    the timeout setting on the socket is not tampered with.
---
 .../apache/geode/internal/net/SocketCreatorJUnitTest.java  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorJUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorJUnitTest.java
index a0480b9..8376d59 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorJUnitTest.java
@@ -15,9 +15,11 @@
 package org.apache.geode.internal.net;
 
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import java.net.Socket;
 import java.security.cert.Certificate;
 import java.security.cert.X509Certificate;
 
@@ -65,8 +67,20 @@ public class SocketCreatorJUnitTest {
     verify(socket).setSoTimeout(timeout);
   }
 
+  @Test
+  public void testConfigureServerPlainSocketDoesntSetSoTimeout() throws Exception {
+    final SocketCreator socketCreator = new SocketCreator(mock(SSLConfig.class));
+    final Socket socket = mock(Socket.class);
+    final int timeout = 1938236;
+
+    socketCreator.handshakeIfSocketIsSSL(socket, timeout);
+    verify(socket, never()).setSoTimeout(timeout);
+  }
+
   private String getSingleKeyKeystore() {
     return TestUtil.getResourcePath(getClass(), "/ssl/trusted.keystore");
   }
 
+
+
 }

-- 
To stop receiving notification emails like this one, please contact
bschuchardt@apache.org.

Mime
View raw message