billbarker 2002/09/20 22:36:52
Modified: coyote/src/java/org/apache/coyote/tomcat5 Constants.java
CoyoteRequest.java
Log:
Initial support for getting client-cert.
This is a little hackish, but is back-portable to 4.1.x without changing the API.
Here, it should probably change once the proposal to expose Coyote to Catalina is
implemented.
If I don't get complaints about this, I'll port to tomcat4.
Revision Changes Path
1.2 +5 -0
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/Constants.java
Index: Constants.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/Constants.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Constants.java 4 Aug 2002 19:39:49 -0000 1.1
+++ Constants.java 21 Sep 2002 05:36:52 -0000 1.2
@@ -82,4 +82,9 @@
*/
public static final String AUTHORIZATION_HEADER = "authorization";
+ /**
+ * SSL Certificate Request Attributite.
+ */
+ public static final String SSL_CERTIFICATE_ATTR =
"org.apache.coyote.request.X509Certificate";
+
}
1.4 +18 -8
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteRequest.java
Index: CoyoteRequest.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteRequest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CoyoteRequest.java 9 Aug 2002 16:58:43 -0000 1.3
+++ CoyoteRequest.java 21 Sep 2002 05:36:52 -0000 1.4
@@ -795,12 +795,22 @@
* @param name Name of the request attribute to return
*/
public Object getAttribute(String name) {
- Object attr=attributes.get(name);
+ Object attr=attributes.get(name);
- if(attr!=null)
- return(attr);
+ if(attr!=null)
+ return(attr);
- return coyoteRequest.getAttribute(name);
+ attr = coyoteRequest.getAttribute(name);
+ if(attr != null)
+ return attr;
+ // XXX Should move to Globals
+ if(Constants.SSL_CERTIFICATE_ATTR.equals(name)) {
+ coyoteRequest.action(ActionCode.ACTION_REQ_SSL_CERTIFICATE, null);
+ attr = getAttribute(Globals.CERTIFICATES_ATTR);
+ if(attr != null)
+ attributes.put(name, attr);
+ }
+ return attr;
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>