You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@locus.apache.org on 2000/10/04 22:24:00 UTC
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/service/http HttpConnectionHandler.java HttpRequestAdapter.java
costin 00/10/04 13:23:58
Modified: src/share/org/apache/tomcat/net Tag: tomcat_32
ServerSocketFactory.java
src/share/org/apache/tomcat/service Tag: tomcat_32
PoolTcpEndpoint.java
src/share/org/apache/tomcat/service/http Tag: tomcat_32
HttpConnectionHandler.java HttpRequestAdapter.java
Log:
Second patch from Stef�n Freyr Stef�nsson <st...@decode.is>.
Make javax.servlet.request.X509Certificate available - this is part
of the spec.
In order to do that, 2 new methods are added - that can't have any negative
impact or add regressions. First ( getServerSocketFactory in Endpoint )
allow clients to directly access the factory used by the endpoint.
Second, preProcessRequest() allows a factory to set attributes and
alter the request before it gets processed.
In the case of non-ssl http nothing change - just an empty function call.
If SSLSocketFactory is used, it'll just add the attribute ( and also
set scheme to "https" - in case you forgot to add "secure=true" attribute
in the config - it's a cleaner way to do that )
The only negative side of the patch is that it adds a dependency between
SSLSocketFactory and tomcat.core.Request. I think this is not a problem -
tomcat 3.2 doesn't claim or tries to support this as an API, and
we know that in 3.3 everything will be clean ( by using ssl interceptor
to set the attributes )
Please let me know if you see any problem with that, and I'll roll back.
I don't think it'll affect the current functionality in any way.
Submitted by: Stef�n Freyr Stef�nsson <st...@decode.is>
Revision Changes Path
No revision
No revision
1.5.2.1 +21 -0 jakarta-tomcat/src/share/org/apache/tomcat/net/Attic/ServerSocketFactory.java
Index: ServerSocketFactory.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/net/Attic/ServerSocketFactory.java,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- ServerSocketFactory.java 2000/06/16 17:08:26 1.5
+++ ServerSocketFactory.java 2000/10/04 20:23:50 1.5.2.1
@@ -194,5 +194,26 @@
public void initSocket( Socket s ) {
}
+
+ /** 3.2 specific hack to allow SSL certificates. This is just
+ a hook to allow SSL factory to set the certificate attributes
+ with minimal changes in tomcat 3.2 - there is only one
+ empty call for non-ssl code.
+
+ In tomcat 3.3 we have a simple and clear mechanism - SSL can
+ be implemented in a normal interceptor ( as all server
+ adapters are in 3.3 ), and this hook is not needed.
+
+ The only bad thing about this hook is that it introduce a
+ dependency on core in ServerSocketFactory. I think this is
+ acceptable, knowing we have a clean solution for 3.3.
+
+ Please note that presenting SSL certificates is part of the
+ spec ( I'm not sure it's "required" or optional, but people
+ expect this to work ).
+ */
+ public void preProcessRequest( Socket s,
+ org.apache.tomcat.core.Request req ) {
+ }
}
No revision
No revision
1.8.2.1 +7 -3 jakarta-tomcat/src/share/org/apache/tomcat/service/Attic/PoolTcpEndpoint.java
Index: PoolTcpEndpoint.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/Attic/PoolTcpEndpoint.java,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -r1.8 -r1.8.2.1
--- PoolTcpEndpoint.java 2000/06/22 23:24:15 1.8
+++ PoolTcpEndpoint.java 2000/10/04 20:23:54 1.8.2.1
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/Attic/PoolTcpEndpoint.java,v 1.8 2000/06/22 23:24:15 alex Exp $
- * $Revision: 1.8 $
- * $Date: 2000/06/22 23:24:15 $
+ * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/Attic/PoolTcpEndpoint.java,v 1.8.2.1 2000/10/04 20:23:54 costin Exp $
+ * $Revision: 1.8.2.1 $
+ * $Date: 2000/10/04 20:23:54 $
*
* ====================================================================
*
@@ -189,6 +189,10 @@
public void setServerSocketFactory( ServerSocketFactory factory ) {
this.factory=factory;
+ }
+
+ public ServerSocketFactory getServerSocketFactory() {
+ return factory;
}
public void setConnectionHandler( TcpConnectionHandler handler ) {
No revision
No revision
1.26.2.3 +6 -3 jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java
Index: HttpConnectionHandler.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java,v
retrieving revision 1.26.2.2
retrieving revision 1.26.2.3
diff -u -r1.26.2.2 -r1.26.2.3
--- HttpConnectionHandler.java 2000/08/16 22:24:26 1.26.2.2
+++ HttpConnectionHandler.java 2000/10/04 20:23:56 1.26.2.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java,v 1.26.2.2 2000/08/16 22:24:26 costin Exp $
- * $Revision: 1.26.2.2 $
- * $Date: 2000/08/16 22:24:26 $
+ * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java,v 1.26.2.3 2000/10/04 20:23:56 costin Exp $
+ * $Revision: 1.26.2.3 $
+ * $Date: 2000/10/04 20:23:56 $
*
* ====================================================================
*
@@ -187,6 +187,9 @@
reqA.setResponse( resA );
reqA.setSocket( socket );
+
+ connection.getEndpoint().getServerSocketFactory().preProcessRequest( socket, reqA );
+
resA.setOutputStream( out );
reqA.readNextRequest(resA);
1.16.2.2 +0 -4 jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java
Index: HttpRequestAdapter.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v
retrieving revision 1.16.2.1
retrieving revision 1.16.2.2
diff -u -r1.16.2.1 -r1.16.2.2
--- HttpRequestAdapter.java 2000/08/14 23:55:37 1.16.2.1
+++ HttpRequestAdapter.java 2000/10/04 20:23:57 1.16.2.2
@@ -1,8 +1,4 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v 1.16.2.1 2000/08/14 23:55:37 costin Exp $
- * $Revision: 1.16.2.1 $
- * $Date: 2000/08/14 23:55:37 $
- *
* ====================================================================
*
* The Apache Software License, Version 1.1