From e4ed7668d3c2fd1617d268cabba89b7682fa75ee Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Thu, 31 Mar 2011 17:36:35 +0000
Subject: [PATCH] Fix issue OpenDJ-103: Replication in 2.4 head and trunk are no longer compatible with 2.4.0 and 2.4.1

---
 opendj-sdk/opends/src/server/org/opends/server/replication/protocol/TLSSocketSession.java |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/TLSSocketSession.java b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/TLSSocketSession.java
index 8a54bc2..72ff1a6 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/TLSSocketSession.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/TLSSocketSession.java
@@ -405,6 +405,11 @@
       setSessionError(e);
       throw e;
     }
+    catch (final RuntimeException e)
+    {
+      setSessionError(e);
+      throw e;
+    }
   }
 
 
@@ -438,14 +443,18 @@
   public void stopEncryption()
   {
     // The secure socket has been configured not to auto close the underlying
-    // plain socket.
-    try
+    // plain socket. We should close it here and properly tear down the SSL
+    // session, but this is not compatible with the existing protocol.
+    if (false)
     {
-      secureSocket.close();
-    }
-    catch (IOException ignored)
-    {
-      // Ignore.
+      try
+      {
+        secureSocket.close();
+      }
+      catch (IOException ignored)
+      {
+        // Ignore.
+      }
     }
 
     input = plainInput;

--
Gitblit v1.10.0