]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Added SSL custom indicators. They can be set using SetEnv directive,
authorMladen Turk <mturk@apache.org>
Wed, 25 Aug 2004 09:56:43 +0000 (09:56 +0000)
committerMladen Turk <mturk@apache.org>
Wed, 25 Aug 2004 09:56:43 +0000 (09:56 +0000)
so we don't need an extra one like the JkEnvVar is in the mod_jk.

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

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

index 19203fe85f37443a0db6f66c1d842dbad7462779..67c0d0b47dbb8a892db677ecd2612a715a03a812 100644 (file)
 #define AJP13_DEF_PORT 8009
 #endif
 
+/* The following environment variables match mod_ssl! */
+#define AJP13_HTTPS_INDICATOR           "HTTPS"
+#define AJP13_SSL_CLIENT_CERT_INDICATOR "SSL_CLIENT_CERT"
+#define AJP13_SSL_CIPHER_INDICATOR      "SSL_CIPHER"
+#define AJP13_SSL_SESSION_INDICATOR     "SSL_SESSION_ID"
+#define AJP13_SSL_KEY_SIZE_INDICATOR    "SSL_CIPHER_USEKEYSIZE"
 
 #if APR_CHARSET_EBCDIC
 
index 5ff3dd50748bf2fbfa1d25215d00d95bbe784a28..2948c7313b20b76c97d71a0481cba64bb1bc1b41 100644 (file)
@@ -211,7 +211,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t    *msg,
     apr_byte_t is_ssl;
     char *remote_host;
     char *uri;
-    const char *session_route;
+    const char *session_route, *envvar;
     const apr_array_header_t *arr = apr_table_elts(r->subprocess_env);
     const apr_table_entry_t *elts = (const apr_table_entry_t *)arr->elts;
 
@@ -345,10 +345,16 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t    *msg,
             return APR_EGENERAL;
         }
     }
-/* XXXX ignored for the moment
-    if (s->ssl_cert_len) {
+/* XXX: Is the subprocess_env a right place?
+ * <Location /examples>
+ *   ProxyPass ajp://remote:8009/servlets-examples 
+ *   SetEnv SSL_SESSION_ID CUSTOM_SSL_SESSION_ID
+ * </Location>
+ */
+    if ((envvar = apr_table_get(r->subprocess_env,
+                                AJP13_SSL_CLIENT_CERT_INDICATOR))) {
         if (ajp_msg_append_uint8(msg, SC_A_SSL_CERT) ||
-            ajp_msg_append_string(msg, s->ssl_cert)) {
+            ajp_msg_append_string(msg, envvar)) {
             ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                    "Error ajp_marshal_into_msgb - "
                    "Error appending the SSL certificates");
@@ -356,25 +362,27 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t    *msg,
         }
     }
 
-    if (s->ssl_cipher) {
+    if ((envvar = apr_table_get(r->subprocess_env,
+                                AJP13_SSL_CIPHER_INDICATOR))) {
         if (ajp_msg_append_uint8(msg, SC_A_SSL_CIPHER) ||
-            ajp_msg_append_string(msg, s->ssl_cipher)) {
+            ajp_msg_append_string(msg, envvar)) {
             ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                    "Error ajp_marshal_into_msgb - "
                    "Error appending the SSL ciphers");
             return APR_EGENERAL;
         }
     }
-    if (s->ssl_session) {
+
+    if ((envvar = apr_table_get(r->subprocess_env,
+                                AJP13_SSL_SESSION_INDICATOR))) {
         if (ajp_msg_append_uint8(msg, SC_A_SSL_SESSION) ||
-            ajp_msg_append_string(msg, s->ssl_session)) {
+            ajp_msg_append_string(msg, envvar)) {
             ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                    "Error ajp_marshal_into_msgb - "
                    "Error appending the SSL session");
             return APR_EGENERAL;
         }
     }
- */
 
     /*
      * ssl_key_size is required by Servlet 2.3 API