From 22094368c2865dcfb6daf8366425212b721a4657 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Thu, 05 Feb 2009 17:42:14 +0000
Subject: [PATCH] Merge ASN1 branch to trunk

---
 opends/src/server/org/opends/server/extensions/StartTLSExtendedOperation.java |   23 ++---------------------
 1 files changed, 2 insertions(+), 21 deletions(-)

diff --git a/opends/src/server/org/opends/server/extensions/StartTLSExtendedOperation.java b/opends/src/server/org/opends/server/extensions/StartTLSExtendedOperation.java
index 0c4b3c8..115a22f 100644
--- a/opends/src/server/org/opends/server/extensions/StartTLSExtendedOperation.java
+++ b/opends/src/server/org/opends/server/extensions/StartTLSExtendedOperation.java
@@ -37,7 +37,6 @@
 import org.opends.server.core.ExtendedOperation;
 import org.opends.server.loggers.debug.DebugTracer;
 import org.opends.server.types.DebugLogLevel;
-import org.opends.server.types.DirectoryException;
 import org.opends.server.types.DisconnectReason;
 import org.opends.server.types.InitializationException;
 import org.opends.server.types.ResultCode;
@@ -160,32 +159,13 @@
     }
 
     MessageBuilder unavailableReason = new MessageBuilder();
-    if (! tlsCapableConnection.tlsProtectionAvailable(unavailableReason))
+    if (! tlsCapableConnection.isTLSAvailable(unavailableReason))
     {
       operation.setResultCode(ResultCode.UNAVAILABLE);
       operation.setErrorMessage(unavailableReason);
       return;
     }
 
-
-    // Actually enable TLS protection on the client connection.  This may fail,
-    // but if it does then the connection will be closed so we'll just need to
-    // log it.
-    try
-    {
-      tlsCapableConnection.enableTLSConnectionSecurityProvider();
-    }
-    catch (DirectoryException de)
-    {
-      if (debugEnabled())
-      {
-        TRACER.debugCaught(DebugLogLevel.ERROR, de);
-      }
-
-      logError(ERR_STARTTLS_ERROR_ON_ENABLE.get(getExceptionMessage(de)));
-    }
-
-
     // TLS was successfully enabled on the client connection, but we need to
     // send the response in the clear.
     operation.setResultCode(ResultCode.SUCCESS);
@@ -194,6 +174,7 @@
     {
       tlsCapableConnection.sendClearResponse(operation);
       operation.setResponseSent();
+      tlsCapableConnection.enableTLS();
     }
     catch (Exception e)
     {

--
Gitblit v1.10.0