You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by cr...@locus.apache.org on 2000/08/10 18:22:32 UTC
cvs commit: jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/http HttpConnector.java HttpProcessor.java
craigmcc 00/08/10 09:22:32
Modified: proposals/catalina/src/conf server.xml
proposals/catalina/src/share/org/apache/tomcat
Connector.java
proposals/catalina/src/share/org/apache/tomcat/connector/http
HttpConnector.java HttpProcessor.java
Log:
Support configuration of a Connector to set the values returned by
getScheme() and isSecure() correctly on an SSL connection.
Revision Changes Path
1.37 +1 -1 jakarta-tomcat/proposals/catalina/src/conf/server.xml
Index: server.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/conf/server.xml,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- server.xml 2000/07/02 18:06:51 1.36
+++ server.xml 2000/08/10 16:22:30 1.37
@@ -29,7 +29,7 @@
<!--
<Connector className="org.apache.tomcat.connector.http.HttpConnector"
port="443" minProcessors="5" maxProcessors="75"
- acceptCount="10" debug="99"
+ acceptCount="10" debug="99" scheme="https" secure="true"
socketFactory="org.apache.tomcat.net.SSLSocketFactory" />
-->
1.4 +36 -4 jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Connector.java
Index: Connector.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Connector.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Connector.java 2000/04/26 06:17:07 1.3
+++ Connector.java 2000/08/10 16:22:31 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Connector.java,v 1.3 2000/04/26 06:17:07 craigmcc Exp $
- * $Revision: 1.3 $
- * $Date: 2000/04/26 06:17:07 $
+ * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Connector.java,v 1.4 2000/08/10 16:22:31 craigmcc Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/08/10 16:22:31 $
*
* ====================================================================
*
@@ -114,7 +114,7 @@
* normative.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.3 $ $Date: 2000/04/26 06:17:07 $
+ * @version $Revision: 1.4 $ $Date: 2000/08/10 16:22:31 $
*/
public interface Connector {
@@ -143,6 +143,38 @@
* Return descriptive information about this Connector implementation.
*/
public String getInfo();
+
+
+ /**
+ * Return the scheme that will be assigned to requests received
+ * through this connector. Default value is "http".
+ */
+ public String getScheme();
+
+
+ /**
+ * Set the scheme that will be assigned to requests received through
+ * this connector.
+ *
+ * @param scheme The new scheme
+ */
+ public void setScheme(String scheme);
+
+
+ /**
+ * Return the secure connection flag that will be assigned to requests
+ * received through this connector. Default value is "false".
+ */
+ public boolean getSecure();
+
+
+ /**
+ * Set the secure connection flag that will be assigned to requests
+ * received through this connector.
+ *
+ * @param secure The new secure connection flag
+ */
+ public void setSecure(boolean secure);
// --------------------------------------------------------- Public Methods
1.9 +66 -4 jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/http/HttpConnector.java
Index: HttpConnector.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/http/HttpConnector.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- HttpConnector.java 2000/07/02 18:07:00 1.8
+++ HttpConnector.java 2000/08/10 16:22:31 1.9
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/http/HttpConnector.java,v 1.8 2000/07/02 18:07:00 remm Exp $
- * $Revision: 1.8 $
- * $Date: 2000/07/02 18:07:00 $
+ * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/http/HttpConnector.java,v 1.9 2000/08/10 16:22:31 craigmcc Exp $
+ * $Revision: 1.9 $
+ * $Date: 2000/08/10 16:22:31 $
*
* ====================================================================
*
@@ -94,7 +94,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
- * @version $Revision: 1.8 $ $Date: 2000/07/02 18:07:00 $
+ * @version $Revision: 1.9 $ $Date: 2000/08/10 16:22:31 $
*/
@@ -199,6 +199,20 @@
/**
+ * The request scheme that will be set on all requests received
+ * through this connector.
+ */
+ private String scheme = "http";
+
+
+ /**
+ * The secure connection flag that will be set on all requests received
+ * through this connector.
+ */
+ private boolean secure = false;
+
+
+ /**
* The server socket through which we listen for incoming TCP connections.
*/
private ServerSocket serverSocket = null;
@@ -472,6 +486,54 @@
parameters.put(name, value);
+ }
+
+
+ /**
+ * Return the scheme that will be assigned to requests received
+ * through this connector. Default value is "http".
+ */
+ public String getScheme() {
+
+ return (this.scheme);
+
+ }
+
+
+ /**
+ * Set the scheme that will be assigned to requests received through
+ * this connector.
+ *
+ * @param scheme The new scheme
+ */
+ public void setScheme(String scheme) {
+
+ this.scheme = scheme;
+
+ }
+
+
+ /**
+ * Return the secure connection flag that will be assigned to requests
+ * received through this connector. Default value is "false".
+ */
+ public boolean getSecure() {
+
+ return (this.secure);
+
+ }
+
+
+ /**
+ * Set the secure connection flag that will be assigned to requests
+ * received through this connector.
+ *
+ * @param secure The new secure connection flag
+ */
+ public void setSecure(boolean secure) {
+
+ this.secure = secure;
+
}
1.19 +6 -6 jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/http/HttpProcessor.java
Index: HttpProcessor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/http/HttpProcessor.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- HttpProcessor.java 2000/08/01 17:54:41 1.18
+++ HttpProcessor.java 2000/08/10 16:22:31 1.19
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/http/HttpProcessor.java,v 1.18 2000/08/01 17:54:41 remm Exp $
- * $Revision: 1.18 $
- * $Date: 2000/08/01 17:54:41 $
+ * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/http/HttpProcessor.java,v 1.19 2000/08/10 16:22:31 craigmcc Exp $
+ * $Revision: 1.19 $
+ * $Date: 2000/08/10 16:22:31 $
*
* ====================================================================
*
@@ -105,7 +105,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
- * @version $Revision: 1.18 $ $Date: 2000/08/01 17:54:41 $
+ * @version $Revision: 1.19 $ $Date: 2000/08/10 16:22:31 $
*/
final class HttpProcessor
@@ -693,8 +693,8 @@
((HttpRequest) request).setMethod(method);
request.setProtocol(protocol);
((HttpRequest) request).setRequestURI(uri);
- request.setSecure(false); // No SSL support
- request.setScheme("http"); // No SSL support
+ request.setSecure(connector.getSecure());
+ request.setScheme(connector.getScheme());
if (debug >= 1)
log(" Request is '" + method + "' for '" + uri +