]> granicus.if.org Git - apache/commitdiff
mod_proxy_ajp: Forward SSL_PROTOCOL. Forthcoming
authorRainer Jung <rjung@apache.org>
Fri, 20 Feb 2015 07:27:44 +0000 (07:27 +0000)
committerRainer Jung <rjung@apache.org>
Fri, 20 Feb 2015 07:27:44 +0000 (07:27 +0000)
versions of Tomcat know how to extract the information
and provide it as a request attribute.

Compatibility is not broken, because we forward it
as a named request attribute, not with a new byte
encoded name.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1661067 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/ajp.h
modules/proxy/ajp_header.c
modules/proxy/ajp_header.h

index d2d681d662cef008acade3d39e132fbe7cdb0314..1b60cfc1e9ea0eb756552660565b2de2db90fe7a 100644 (file)
@@ -60,6 +60,7 @@
 
 /* The following environment variables match mod_ssl! */
 #define AJP13_HTTPS_INDICATOR           "HTTPS"
+#define AJP13_SSL_PROTOCOL_INDICATOR    "SSL_PROTOCOL"
 #define AJP13_SSL_CLIENT_CERT_INDICATOR "SSL_CLIENT_CERT"
 #define AJP13_SSL_CIPHER_INDICATOR      "SSL_CIPHER"
 #define AJP13_SSL_SESSION_INDICATOR     "SSL_SESSION_ID"
index 8f9a2fcd3dea44349c85fc9ab5cc59f6d3334db8..edb9d23cac965baaff6859816f98fc1aeef46113 100644 (file)
@@ -415,6 +415,26 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
             return AJP_EOVERFLOW;
         }
     }
+    /* Forward the SSL protocol name.
+     * Modern Tomcat versions know how to retrieve
+     * the protocol name from this attribute.
+     */
+    if (is_ssl) {
+        if ((envvar = ap_proxy_ssl_val(r->pool, r->server, r->connection, r,
+                                       AJP13_SSL_PROTOCOL_INDICATOR))
+            && envvar[0]) {
+            const char *key = SC_A_SSL_PROTOCOL;
+            if (ajp_msg_append_uint8(msg, SC_A_REQ_ATTRIBUTE) ||
+                ajp_msg_append_string(msg, key)   ||
+                ajp_msg_append_string(msg, envvar)) {
+                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02830)
+                        "ajp_marshal_into_msgb: "
+                        "Error appending attribute %s=%s",
+                        key, envvar);
+                return AJP_EOVERFLOW;
+            }
+        }
+    }
     /* Forward the remote port information, which was forgotten
      * from the builtin data of the AJP 13 protocol.
      * Since the servlet spec allows to retrieve it via getRemotePort(),
index 0f5fdaa81eab85061cc936057ef0c932c1632c2f..4c22ac7c6104c631dfb3e311f5589e5d5389f879 100644 (file)
 /*
  * AJP private request attributes
  *
+ * The following request attribute is recognized by Tomcat
+ * to contain the SSL protocol name
+ */
+#define SC_A_SSL_PROTOCOL        ("AJP_SSL_PROTOCOL")
+/*
  * The following request attribute is recognized by Tomcat
  * to contain the forwarded remote port.
  */