Skip to content

Commit efc0a47

Browse files
committed
mod_proxy/ssl: Proxy SSL client certificate
configuration and other proxy SSL configurations broken inside <Proxy> context. PR 63430 Triggered by r1855646+r1855748. Patch from rpluem (proxy) and ylavic (ssl). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1859371 13f79535-47bb-0310-9956-ffa450edef68
1 parent 06b6c86 commit efc0a47

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
-*- coding: utf-8 -*-
22
Changes with Apache 2.5.1
33

4+
*) mod_proxy/ssl: Proxy SSL client certificate configuration and other proxy
5+
SSL configurations broken inside <Proxy> context. PR 63430.
6+
[Ruediger Pluem, Yann Ylavic]
7+
48
*) mod_reqtimeout: Fix default rates missing (not applied) in 2.4.39.
59
PR 63325. [Yann Ylavic]
610

modules/proxy/mod_proxy_http.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,13 +2107,10 @@ static int proxy_http_handler(request_rec *r, proxy_worker *worker,
21072107
}
21082108

21092109
/* Step Three: Create conn_rec */
2110+
if ((status = ap_proxy_connection_create_ex(proxy_function,
2111+
backend, r)) != OK)
2112+
break;
21102113
req->origin = backend->connection;
2111-
if (!req->origin) {
2112-
if ((status = ap_proxy_connection_create_ex(proxy_function,
2113-
backend, r)) != OK)
2114-
break;
2115-
req->origin = backend->connection;
2116-
}
21172114

21182115
/* Don't recycle the connection if prefetch (above) told not to do so */
21192116
if (toclose) {

modules/ssl/mod_ssl.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,20 @@ static SSLConnRec *ssl_init_connection_ctx(conn_rec *c,
492492
SSLConnRec *sslconn = myConnConfig(c);
493493
int need_setup = 0;
494494

495+
/* mod_proxy's (r->)per_dir_config has the lifetime of the request, thus
496+
* it uses ssl_engine_set() to reset sslconn->dc when reusing SSL backend
497+
* connections, so we must fall through here. But in the case where we are
498+
* called from ssl_init_ssl_connection() with no per_dir_config (which also
499+
* includes mod_proxy's later run_pre_connection call), sslconn->dc should
500+
* be preserved if it's already set.
501+
*/
495502
if (!sslconn) {
496503
sslconn = apr_pcalloc(c->pool, sizeof(*sslconn));
497504
need_setup = 1;
498505
}
506+
else if (!new_proxy) {
507+
return sslconn;
508+
}
499509

500510
/* Reinit dc in any case because it may be r->per_dir_config scoped
501511
* and thus a caller like mod_proxy needs to update it per request.

0 commit comments

Comments
 (0)