tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James E Jurach Jr." <muad...@erf.net>
Subject PATCH: jk for tomcat4: Ajp13Connector.java
Date Mon, 22 Oct 2001 19:22:54 GMT
I hacked out the patch below without completely understanding all the
issues involved, or all the ramifications of this change.  I crafted it by
eyeying org.apache.catalina.connector.http.HttpConnector, and after
applying it, mod_jk -> TC4 AJP13 connector appears to work.  Maybe someone
in the know can validate this change.

james


Index: java/org/apache/ajp/tomcat4/Ajp13Connector.java
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat-connectors/jk/java/org/apache/ajp/tomcat4/Ajp13Connector.java,v
retrieving revision 1.6
diff -u -3 -r1.6 Ajp13Connector.java
--- java/org/apache/ajp/tomcat4/Ajp13Connector.java	2001/10/08 20:18:12	1.6
+++ java/org/apache/ajp/tomcat4/Ajp13Connector.java	2001/10/22 18:21:33
@@ -69,6 +69,11 @@
 import java.net.ServerSocket;
 import java.net.Socket;
 import java.security.AccessControlException;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
+import java.security.UnrecoverableKeyException;
+import java.security.KeyManagementException;
 import java.util.Stack;
 import java.util.Vector;
 import java.util.Enumeration;
@@ -85,7 +90,7 @@
 import org.apache.catalina.Response;
 import org.apache.catalina.Service;
 import org.apache.catalina.net.DefaultServerSocketFactory;
-import org.apache.catalina.net.ServerSocketFactory;
+import org.apache.catalina.ServerSocketFactory;
 import org.apache.catalina.util.LifecycleSupport;
 import org.apache.catalina.util.StringManager;
 
@@ -731,7 +736,9 @@
      *
      * @exception IOException if an input/output error occurs
      */
-    private ServerSocket open() throws IOException {
+    private ServerSocket open() throws IOException, KeyStoreException,
+	NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException,
+	KeyManagementException {
 
         // Acquire the server socket factory for this Connector
         ServerSocketFactory factory = getFactory();
@@ -792,6 +799,21 @@
                     // If reopening fails, exit
                     logger.log("socket reopen: ", ex);
                     break;
+                } catch (KeyStoreException kse) {
+                    logger.log("socket reopen, keystore problem: ", kse);
+                    break;
+                } catch (NoSuchAlgorithmException nsae) {
+                    logger.log("socket reopen, keystore algorithm problem: ", nsae);
+                    break;
+                } catch (CertificateException ce) {
+                    logger.log("socket reopen, certificate problem: ", ce);
+                    break;
+                } catch (UnrecoverableKeyException uke) {
+                    logger.log("socket reopen, unrecoverable key: ", uke);
+                    break;
+                } catch (KeyManagementException kme) {
+                    logger.log("socket reopen, key management problem: ", kme);
+                    break;
                 }
                 continue;
 	    }
@@ -903,6 +925,8 @@
 	try {
 	    serverSocket = open();
 	} catch (IOException e) {
+	    throw new LifecycleException(threadName + ".open", e);
+        } catch (Exception e) {
 	    throw new LifecycleException(threadName + ".open", e);
 	}
 

Mime
View raw message