Author: markt
Date: Wed Jan  8 14:18:39 2014
New Revision: 1556541

URL: http://svn.apache.org/r1556541
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55749
Improve the error message when SSLEngine is disabled in AprLifecycleListener 
and SSL is configured for an APR/native connector.

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
    
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1556541&r1=1556540&r2=1556541&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Jan  8 14:18:39 2014
@@ -32,13 +32,6 @@ PATCHES PROPOSED TO BACKPORT:
   [ New proposals should be added at the end of the list ]
 
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55749
-  Improve the error message when SSLEngine is disabled in AprLifecycleListener
-  and SSL is configured for an APR/native connector.
-  http://people.apache.org/~markt/patches/2013-11-12-bug55749-tc6.patch
-  +1: markt, kkolinko, remm
-  -1:
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55759
   Update the Eclipse compiler to 4.3.1
   http://svn.apache.org/viewvc?view=revision&revision=1539953

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1556541&r1=1556540&r2=1556541&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Wed 
Jan  8 14:18:39 2014
@@ -633,6 +633,12 @@ public class AprEndpoint extends Abstrac
         if (initialized)
             return;
 
+        if (rootPool != 0) {
+            // A previous init() call failed
+            throw new IllegalStateException(
+                    sm.getString("endpoint.apr.previousInitFailed"));
+        }
+        
         // Create the root APR memory pool
         rootPool = Pool.create(0);
         // Create the pool for the server socket
@@ -776,7 +782,15 @@ public class AprEndpoint extends Abstrac
             }
 
             // Create SSL Context
-            sslContext = SSLContext.make(rootPool, value, SSL.SSL_MODE_SERVER);
+            try {
+                sslContext = SSLContext.make(rootPool, value, 
SSL.SSL_MODE_SERVER);
+            } catch (Exception e) {
+                // If the sslEngine is disabled on the AprLifecycleListener
+                // there will be an Exception here but there is no way to check
+                // the AprLifecycleListener settings from here
+                throw new Exception(
+                        sm.getString("endpoint.apr.failSslContextMake"), e);
+            }
 
             // Set cipher order: client (default) or server
             if (SSLHonorCipherOrder) {

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties?rev=1556541&r1=1556540&r2=1556541&view=diff
==============================================================================
--- 
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties
 (original)
+++ 
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties
 Wed Jan  8 14:18:39 2014
@@ -48,4 +48,6 @@ endpoint.warn.noHonorCipherOrder='Honor 
 endpoint.debug.channelCloseFail=Failed to close channel
 endpoint.debug.socketCloseFail=Failed to close socket
 endpoint.apr.noSslCertFile=Connector attribute SSLCertificateFile must be 
defined when using SSL with APR
+endpoint.apr.failSslContextMake=Unable to create SSLContext. Check that 
SSLEngine is enabled in the AprLifecycleListener, the AprLifecycleListener has 
initialised correctly and that a valid SSLProtocol has been specified
 endpoint.apr.invalidSslProtocol=An invalid value [{0}] was provided for the 
SSLProtocol attribute
+endpoint.apr.previousInitFailed=Unable to initialise endpoint. A previous call 
to init() failed. See previous log messages for details.

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1556541&r1=1556540&r2=1556541&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Wed Jan  8 14:18:39 2014
@@ -112,6 +112,11 @@
         Add support for limiting the size of chunk extensions when using 
chunked
         encoding. (markt)
       </fix>
+      <fix>
+        <bug>55749</bug>: Improve the error message when SSLEngine is disabled
+        in the AprLifecycleListener and SSL is configured for an APR/native
+        connector. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to