From: Mladen Turk Date: Wed, 25 Aug 2004 09:56:43 +0000 (+0000) Subject: Added SSL custom indicators. They can be set using SetEnv directive, X-Git-Tag: STRIKER_2_1_0_RC1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4adc3e69d96ffe95db96ef4c9df4b34de5916cb8;p=thirdparty%2Fapache%2Fhttpd.git Added SSL custom indicators. They can be set using SetEnv directive, 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 --- diff --git a/modules/proxy/ajp.h b/modules/proxy/ajp.h index 19203fe85f3..67c0d0b47db 100644 --- a/modules/proxy/ajp.h +++ b/modules/proxy/ajp.h @@ -47,6 +47,12 @@ #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 diff --git a/modules/proxy/ajp_header.c b/modules/proxy/ajp_header.c index 5ff3dd50748..2948c7313b2 100644 --- a/modules/proxy/ajp_header.c +++ b/modules/proxy/ajp_header.c @@ -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? + * + * ProxyPass ajp://remote:8009/servlets-examples + * SetEnv SSL_SESSION_ID CUSTOM_SSL_SESSION_ID + * + */ + 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