tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1166686 - in /tomcat/trunk: java/org/apache/catalina/Globals.java java/org/apache/catalina/connector/Request.java java/org/apache/catalina/valves/SSLValve.java java/org/apache/tomcat/util/net/SSLSupport.java webapps/docs/ssl-howto.xml
Date Thu, 08 Sep 2011 13:43:02 GMT
Author: markt
Date: Thu Sep  8 13:43:02 2011
New Revision: 1166686

URL: http://svn.apache.org/viewvc?rev=1166686&view=rev
Log:
Tomcat 6 introduced a custom attribute for SSL session ID.
Servlet 3 introduced a standard attribute for this.
Support both, deprecating the custom attribute.

Modified:
    tomcat/trunk/java/org/apache/catalina/Globals.java
    tomcat/trunk/java/org/apache/catalina/connector/Request.java
    tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java
    tomcat/trunk/java/org/apache/tomcat/util/net/SSLSupport.java
    tomcat/trunk/webapps/docs/ssl-howto.xml

Modified: tomcat/trunk/java/org/apache/catalina/Globals.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Globals.java?rev=1166686&r1=1166685&r2=1166686&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/Globals.java (original)
+++ tomcat/trunk/java/org/apache/catalina/Globals.java Thu Sep  8 13:43:02 2011
@@ -98,9 +98,15 @@ public final class Globals {
      * for this SSL connection (as an object of type java.lang.String).
      */
     public static final String SSL_SESSION_ID_ATTR =
+        "javax.servlet.request.ssl_session_id";
+    /**
+     * Tomcat specific attribute as used in Tomcat 6.
+     * @deprecated
+     */
+    @Deprecated
+    public static final String SSL_SESSION_ID_TOMCAT_ATTR =
         "javax.servlet.request.ssl_session";
 
-
     /**
      * The request attribute key for the session manager.
      * This one is a Tomcat extension to the Servlet spec.

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1166686&r1=1166685&r2=1166686&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Thu Sep  8 13:43:02 2011
@@ -965,6 +965,7 @@ public class Request
             attr = coyoteRequest.getAttribute(Globals.SSL_SESSION_ID_ATTR);
             if(attr != null) {
                 attributes.put(Globals.SSL_SESSION_ID_ATTR, attr);
+                attributes.put(Globals.SSL_SESSION_ID_TOMCAT_ATTR, attr);
             }
             attr = coyoteRequest.getAttribute(Globals.SSL_SESSION_MGR_ATTR);
             if(attr != null) {
@@ -985,6 +986,7 @@ public class Request
             Globals.CIPHER_SUITE_ATTR.equals(name) ||
             Globals.KEY_SIZE_ATTR.equals(name)  ||
             Globals.SSL_SESSION_ID_ATTR.equals(name) ||
+            Globals.SSL_SESSION_ID_TOMCAT_ATTR.equals(name) ||
             Globals.SSL_SESSION_MGR_ATTR.equals(name);
     }
 
@@ -1003,6 +1005,8 @@ public class Request
      * <li>{@link Globals#CIPHER_SUITE_ATTR} (SSL connections only)</li>
      * <li>{@link Globals#KEY_SIZE_ATTR} (SSL connections only)</li>
      * <li>{@link Globals#SSL_SESSION_ID_ATTR} (SSL connections only)</li>
+     * <li>{@link Globals#SSL_SESSION_ID_TOMCAT_ATTR} (SSL connections only)
+     * </li>
      * <li>{@link Globals#SSL_SESSION_MGR_ATTR} (SSL connections only)</li>
      * </ul>
      * The underlying connector may also expose request attributes. These all

Modified: tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java?rev=1166686&r1=1166685&r2=1166686&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java Thu Sep  8 13:43:02 2011
@@ -125,6 +125,7 @@ public class SSLValve extends ValveBase 
         strcert0 = mygetHeader(request, "ssl_session_id");
         if (strcert0 != null) {
             request.setAttribute(Globals.SSL_SESSION_ID_ATTR, strcert0);
+            request.setAttribute(Globals.SSL_SESSION_ID_TOMCAT_ATTR, strcert0);
         }
         strcert0 = mygetHeader(request, "ssl_cipher_usekeysize");
         if (strcert0 != null) {

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SSLSupport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/SSLSupport.java?rev=1166686&r1=1166685&r2=1166686&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/SSLSupport.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/SSLSupport.java Thu Sep  8 13:43:02 2011
@@ -45,7 +45,7 @@ public interface SSLSupport {
      * This one is a Tomcat extension to the Servlet spec.
      */
     public static final String SESSION_ID_KEY =
-            "javax.servlet.request.ssl_session";
+            "javax.servlet.request.ssl_session_id";
 
     /**
      * The request attribute key for the session manager.

Modified: tomcat/trunk/webapps/docs/ssl-howto.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/ssl-howto.xml?rev=1166686&r1=1166685&r2=1166686&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/ssl-howto.xml (original)
+++ tomcat/trunk/webapps/docs/ssl-howto.xml Thu Sep  8 13:43:02 2011
@@ -582,7 +582,7 @@ public class SessionTrackingModeListener
 <p>To access the SSL session ID from the request, use:<br />
 
   <code>
-    String sslID = (String)request.getAttribute("javax.servlet.request.ssl_session");
+    String sslID = (String)request.getAttribute("javax.servlet.request.ssl_session_id");
   </code>
 <br />
 For additional discussion on this area, please see



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


Mime
View raw message