|
|
41a6c3 |
|
|
|
41a6c3 |
Ugly hack to enable mod_ssl and mod_nss to "share" hooks.
|
|
|
41a6c3 |
|
|
|
41a6c3 |
--- httpd-2.4.6/modules/ssl/mod_ssl.c.sslmultiproxy
|
|
|
41a6c3 |
+++ httpd-2.4.6/modules/ssl/mod_ssl.c
|
|
|
41a6c3 |
@@ -369,6 +369,9 @@ static SSLConnRec *ssl_init_connection_c
|
|
|
41a6c3 |
return sslconn;
|
|
|
41a6c3 |
}
|
|
|
41a6c3 |
|
|
|
41a6c3 |
+static typeof(ssl_proxy_enable) *othermod_proxy_enable;
|
|
|
41a6c3 |
+static typeof(ssl_engine_disable) *othermod_engine_disable;
|
|
|
41a6c3 |
+
|
|
|
41a6c3 |
int ssl_proxy_enable(conn_rec *c)
|
|
|
41a6c3 |
{
|
|
|
41a6c3 |
SSLSrvConfigRec *sc;
|
|
|
41a6c3 |
@@ -377,6 +380,12 @@ int ssl_proxy_enable(conn_rec *c)
|
|
|
41a6c3 |
sc = mySrvConfig(sslconn->server);
|
|
|
41a6c3 |
|
|
|
41a6c3 |
if (!sc->proxy_enabled) {
|
|
|
41a6c3 |
+ if (othermod_proxy_enable) {
|
|
|
41a6c3 |
+ ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, c,
|
|
|
41a6c3 |
+ "mod_ssl proxy not configured, passing through to other module.");
|
|
|
41a6c3 |
+ return othermod_proxy_enable(c);
|
|
|
41a6c3 |
+ }
|
|
|
41a6c3 |
+
|
|
|
41a6c3 |
ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c, APLOGNO(01961)
|
|
|
41a6c3 |
"SSL Proxy requested for %s but not enabled "
|
|
|
41a6c3 |
"[Hint: SSLProxyEngine]", sc->vhost_id);
|
|
|
41a6c3 |
@@ -396,6 +405,10 @@ int ssl_engine_disable(conn_rec *c)
|
|
|
41a6c3 |
|
|
|
41a6c3 |
SSLConnRec *sslconn = myConnConfig(c);
|
|
|
41a6c3 |
|
|
|
41a6c3 |
+ if (othermod_engine_disable) {
|
|
|
41a6c3 |
+ othermod_engine_disable(c);
|
|
|
41a6c3 |
+ }
|
|
|
41a6c3 |
+
|
|
|
41a6c3 |
if (sslconn) {
|
|
|
41a6c3 |
sc = mySrvConfig(sslconn->server);
|
|
|
41a6c3 |
}
|
|
|
41a6c3 |
@@ -612,6 +625,9 @@ static void ssl_register_hooks(apr_pool_
|
|
|
41a6c3 |
ap_hook_post_read_request(ssl_hook_ReadReq, pre_prr,NULL, APR_HOOK_MIDDLE);
|
|
|
41a6c3 |
|
|
|
41a6c3 |
ssl_var_register(p);
|
|
|
41a6c3 |
+
|
|
|
41a6c3 |
+ othermod_proxy_enable = APR_RETRIEVE_OPTIONAL_FN(ssl_proxy_enable);
|
|
|
41a6c3 |
+ othermod_engine_disable = APR_RETRIEVE_OPTIONAL_FN(ssl_engine_disable);
|
|
|
41a6c3 |
|
|
|
41a6c3 |
APR_REGISTER_OPTIONAL_FN(ssl_proxy_enable);
|
|
|
41a6c3 |
APR_REGISTER_OPTIONAL_FN(ssl_engine_disable);
|
|
|
41a6c3 |
--- httpd-2.4.6/modules/ssl/ssl_engine_vars.c.sslmultiproxy
|
|
|
41a6c3 |
+++ httpd-2.4.6/modules/ssl/ssl_engine_vars.c
|
|
|
41a6c3 |
@@ -53,10 +53,15 @@ static void ssl_var_lookup_ssl_cipher_b
|
|
|
41a6c3 |
static char *ssl_var_lookup_ssl_version(apr_pool_t *p, char *var);
|
|
|
41a6c3 |
static char *ssl_var_lookup_ssl_compress_meth(SSL *ssl);
|
|
|
41a6c3 |
|
|
|
41a6c3 |
+static APR_OPTIONAL_FN_TYPE(ssl_is_https) *othermod_is_https;
|
|
|
41a6c3 |
+static APR_OPTIONAL_FN_TYPE(ssl_var_lookup) *othermod_var_lookup;
|
|
|
41a6c3 |
+
|
|
|
41a6c3 |
static int ssl_is_https(conn_rec *c)
|
|
|
41a6c3 |
{
|
|
|
41a6c3 |
SSLConnRec *sslconn = myConnConfig(c);
|
|
|
41a6c3 |
- return sslconn && sslconn->ssl;
|
|
|
41a6c3 |
+
|
|
|
41a6c3 |
+ return (sslconn && sslconn->ssl)
|
|
|
41a6c3 |
+ || (othermod_is_https && othermod_is_https(c));
|
|
|
41a6c3 |
}
|
|
|
41a6c3 |
|
|
|
41a6c3 |
static const char var_interface[] = "mod_ssl/" AP_SERVER_BASEREVISION;
|
|
|
41a6c3 |
@@ -106,6 +111,9 @@ void ssl_var_register(apr_pool_t *p)
|
|
|
41a6c3 |
{
|
|
|
41a6c3 |
char *cp, *cp2;
|
|
|
41a6c3 |
|
|
|
41a6c3 |
+ othermod_is_https = APR_RETRIEVE_OPTIONAL_FN(ssl_is_https);
|
|
|
41a6c3 |
+ othermod_var_lookup = APR_RETRIEVE_OPTIONAL_FN(ssl_var_lookup);
|
|
|
41a6c3 |
+
|
|
|
41a6c3 |
APR_REGISTER_OPTIONAL_FN(ssl_is_https);
|
|
|
41a6c3 |
APR_REGISTER_OPTIONAL_FN(ssl_var_lookup);
|
|
|
41a6c3 |
APR_REGISTER_OPTIONAL_FN(ssl_ext_list);
|
|
|
41a6c3 |
@@ -241,6 +249,15 @@ char *ssl_var_lookup(apr_pool_t *p, serv
|
|
|
41a6c3 |
*/
|
|
|
41a6c3 |
if (result == NULL && c != NULL) {
|
|
|
41a6c3 |
SSLConnRec *sslconn = myConnConfig(c);
|
|
|
41a6c3 |
+
|
|
|
41a6c3 |
+ if (strlen(var) > 4 && strcEQn(var, "SSL_", 4)
|
|
|
41a6c3 |
+ && (!sslconn || !sslconn->ssl) && othermod_var_lookup) {
|
|
|
41a6c3 |
+ /* For an SSL_* variable, if mod_ssl is not enabled for
|
|
|
41a6c3 |
+ * this connection and another SSL module is present, pass
|
|
|
41a6c3 |
+ * through to that module. */
|
|
|
41a6c3 |
+ return othermod_var_lookup(p, s, c, r, var);
|
|
|
41a6c3 |
+ }
|
|
|
41a6c3 |
+
|
|
|
41a6c3 |
if (strlen(var) > 4 && strcEQn(var, "SSL_", 4)
|
|
|
41a6c3 |
&& sslconn && sslconn->ssl)
|
|
|
41a6c3 |
result = ssl_var_lookup_ssl(p, c, r, var+4);
|