View | Details | Raw Unified | Return to bug 37355
Collapse All | Expand All

(-)modules/proxy/mod_proxy.h.orig (-1 / +6 lines)
Lines 99-104 Link Here
99
    const char *scheme;     /* the schemes handled by this proxy, or '*' */
99
    const char *scheme;     /* the schemes handled by this proxy, or '*' */
100
    const char *protocol;   /* the scheme used to talk to this proxy */
100
    const char *protocol;   /* the scheme used to talk to this proxy */
101
    const char *hostname;   /* the hostname of this proxy */
101
    const char *hostname;   /* the hostname of this proxy */
102
    const char *auth;       /* base64encode(<proxyuser>:<proxypasswd>) */
102
    ap_regex_t *regexp;     /* compiled regex (if any) for the remote */
103
    ap_regex_t *regexp;     /* compiled regex (if any) for the remote */
103
    int use_regex;          /* simple boolean. True if we have a regex pattern */
104
    int use_regex;          /* simple boolean. True if we have a regex pattern */
104
    apr_port_t  port;       /* the port for this proxy */
105
    apr_port_t  port;       /* the port for this proxy */
Lines 494-500 Link Here
494
495
495
APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, scheme_handler, (request_rec *r,
496
APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, scheme_handler, (request_rec *r,
496
                          proxy_worker *worker, proxy_server_conf *conf, char *url,
497
                          proxy_worker *worker, proxy_server_conf *conf, char *url,
497
                          const char *proxyhost, apr_port_t proxyport))
498
                          const char *proxyhost, apr_port_t proxyport,
499
                          const char *proxyauth))
500
498
APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, canon_handler, (request_rec *r,
501
APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, canon_handler, (request_rec *r,
499
                          char *url))
502
                          char *url))
500
503
Lines 776-781 Link Here
776
 * @param url     request url
779
 * @param url     request url
777
 * @param proxyname are we connecting directly or via a proxy
780
 * @param proxyname are we connecting directly or via a proxy
778
 * @param proxyport proxy host port
781
 * @param proxyport proxy host port
782
 * @param proxyauth proxy authentication
779
 * @param server_portstr Via headers server port
783
 * @param server_portstr Via headers server port
780
 * @param server_portstr_size size of the server_portstr buffer
784
 * @param server_portstr_size size of the server_portstr buffer
781
 * @return         OK or HTTP_XXX error
785
 * @return         OK or HTTP_XXX error
Lines 788-793 Link Here
788
                                                 char **url,
792
                                                 char **url,
789
                                                 const char *proxyname,
793
                                                 const char *proxyname,
790
                                                 apr_port_t proxyport,
794
                                                 apr_port_t proxyport,
795
                                                 const char *proxyauth,
791
                                                 char *server_portstr,
796
                                                 char *server_portstr,
792
                                                 int server_portstr_size);
797
                                                 int server_portstr_size);
793
798
(-)modules/proxy/mod_proxy_ajp.c.orig (-2 / +4 lines)
Lines 691-697 Link Here
691
static int proxy_ajp_handler(request_rec *r, proxy_worker *worker,
691
static int proxy_ajp_handler(request_rec *r, proxy_worker *worker,
692
                             proxy_server_conf *conf,
692
                             proxy_server_conf *conf,
693
                             char *url, const char *proxyname,
693
                             char *url, const char *proxyname,
694
                             apr_port_t proxyport)
694
                             apr_port_t proxyport,
695
                             const char *proxyauth)
695
{
696
{
696
    int status;
697
    int status;
697
    char server_portstr[32];
698
    char server_portstr[32];
Lines 731-737 Link Here
731
        char *locurl = url;
732
        char *locurl = url;
732
        /* Step One: Determine Who To Connect To */
733
        /* Step One: Determine Who To Connect To */
733
        status = ap_proxy_determine_connection(p, r, conf, worker, backend,
734
        status = ap_proxy_determine_connection(p, r, conf, worker, backend,
734
                                               uri, &locurl, proxyname, proxyport,
735
                                               uri, &locurl, 
736
                                               proxyname, proxyport,proxyauth,
735
                                               server_portstr,
737
                                               server_portstr,
736
                                               sizeof(server_portstr));
738
                                               sizeof(server_portstr));
737
739
(-)modules/proxy/mod_proxy_connect.c.orig (-1 / +11 lines)
Lines 194-200 Link Here
194
static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
194
static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
195
                                 proxy_server_conf *conf,
195
                                 proxy_server_conf *conf,
196
                                 char *url, const char *proxyname,
196
                                 char *url, const char *proxyname,
197
                                 apr_port_t proxyport)
197
                                 apr_port_t proxyport,
198
                                 const char *proxyauth)
198
{
199
{
199
    connect_conf *c_conf =
200
    connect_conf *c_conf =
200
        ap_get_module_config(r->server->module_config, &proxy_connect_module);
201
        ap_get_module_config(r->server->module_config, &proxy_connect_module);
Lines 370-375 Link Here
370
                      "sending the CONNECT request to the remote proxy");
371
                      "sending the CONNECT request to the remote proxy");
371
        ap_fprintf(backconn->output_filters, bb,
372
        ap_fprintf(backconn->output_filters, bb,
372
                   "CONNECT %s HTTP/1.0" CRLF, r->uri);
373
                   "CONNECT %s HTTP/1.0" CRLF, r->uri);
374
375
        /* add Proxyauth Header if configured
376
         */
377
        if (proxyauth) {
378
            ap_fprintf(backconn->output_filters, bb,
379
                       "Proxy-Authorization: Basic %s" CRLF,
380
                       proxyauth);
381
        }
382
373
        ap_fprintf(backconn->output_filters, bb,
383
        ap_fprintf(backconn->output_filters, bb,
374
                   "Proxy-agent: %s" CRLF CRLF, ap_get_server_banner());
384
                   "Proxy-agent: %s" CRLF CRLF, ap_get_server_banner());
375
        ap_fflush(backconn->output_filters, bb);
385
        ap_fflush(backconn->output_filters, bb);
(-)modules/proxy/mod_proxy.c.orig (-15 / +41 lines)
Lines 1048-1054 Link Here
1048
                    access_status = proxy_run_scheme_handler(r, worker,
1048
                    access_status = proxy_run_scheme_handler(r, worker,
1049
                                                             conf, url,
1049
                                                             conf, url,
1050
                                                             ents[i].hostname,
1050
                                                             ents[i].hostname,
1051
                                                             ents[i].port);
1051
                                                             ents[i].port,
1052
                                                             ents[i].auth);
1052
1053
1053
                    /* Did the scheme handler process the request? */
1054
                    /* Did the scheme handler process the request? */
1054
                    if (access_status != DECLINED) {
1055
                    if (access_status != DECLINED) {
Lines 1100-1106 Link Here
1100
                      scheme, attempts);
1101
                      scheme, attempts);
1101
        AP_PROXY_RUN(r, worker, conf, url, attempts);
1102
        AP_PROXY_RUN(r, worker, conf, url, attempts);
1102
        access_status = proxy_run_scheme_handler(r, worker, conf,
1103
        access_status = proxy_run_scheme_handler(r, worker, conf,
1103
                                                 url, NULL, 0);
1104
                                                 url, NULL, 0, NULL);
1104
        if (access_status == OK)
1105
        if (access_status == OK)
1105
            break;
1106
            break;
1106
        else if (access_status == HTTP_INTERNAL_SERVER_ERROR) {
1107
        else if (access_status == HTTP_INTERNAL_SERVER_ERROR) {
Lines 1339-1345 Link Here
1339
    proxy_server_conf *conf =
1340
    proxy_server_conf *conf =
1340
    (proxy_server_conf *) ap_get_module_config(s->module_config, &proxy_module);
1341
    (proxy_server_conf *) ap_get_module_config(s->module_config, &proxy_module);
1341
    struct proxy_remote *new;
1342
    struct proxy_remote *new;
1342
    char *p, *q;
1343
    char *p, *q, *a;
1343
    char *r, *f, *scheme;
1344
    char *r, *f, *scheme;
1344
    ap_regex_t *reg = NULL;
1345
    ap_regex_t *reg = NULL;
1345
    int port;
1346
    int port;
Lines 1347-1352 Link Here
1347
    r = apr_pstrdup(cmd->pool, r1);
1348
    r = apr_pstrdup(cmd->pool, r1);
1348
    scheme = apr_pstrdup(cmd->pool, r1);
1349
    scheme = apr_pstrdup(cmd->pool, r1);
1349
    f = apr_pstrdup(cmd->pool, f1);
1350
    f = apr_pstrdup(cmd->pool, f1);
1351
    /* separate different items from remote proxy server configuration
1352
     *    r = <scheme>://[<auth>@]<host>[:<port>]
1353
     */
1354
    /* separate scheme (must) */
1350
    p = strchr(r, ':');
1355
    p = strchr(r, ':');
1351
    if (p == NULL || p[1] != '/' || p[2] != '/' || p[3] == '\0') {
1356
    if (p == NULL || p[1] != '/' || p[2] != '/' || p[3] == '\0') {
1352
        if (regex)
1357
        if (regex)
Lines 1355-1363 Link Here
1355
            return "ProxyRemote: Bad syntax for a remote proxy server";
1360
            return "ProxyRemote: Bad syntax for a remote proxy server";
1356
    }
1361
    }
1357
    else {
1362
    else {
1358
        scheme[p-r] = 0;
1363
        scheme[p-r] = '\0';
1364
    }
1365
    *p = '\0';   /* terminate r (scheme) */
1366
    p+=3;
1367
    /* separate authentication string (optional, default = NULL) */
1368
    q = strchr(p, '@');
1369
    if (q != NULL) {
1370
        *q = '\0';
1371
        /* missing: syntax check of the auth string
1372
         *     but do we really need this?
1373
         */
1374
        a = ap_pbase64encode(cmd->pool, p);
1375
        p = q;
1376
        p+=1;
1377
    }
1378
    else {
1379
        a = NULL;
1359
    }
1380
    }
1360
    q = strchr(p + 3, ':');
1381
    /* separate port (optional, default = default port of scheme) */
1382
    q = strchr(p, ':');
1361
    if (q != NULL) {
1383
    if (q != NULL) {
1362
        if (sscanf(q + 1, "%u", &port) != 1 || port > 65535) {
1384
        if (sscanf(q + 1, "%u", &port) != 1 || port > 65535) {
1363
            if (regex)
1385
            if (regex)
Lines 1367-1384 Link Here
1367
        }
1389
        }
1368
        *q = '\0';
1390
        *q = '\0';
1369
    }
1391
    }
1370
    else
1392
    else {
1371
        port = -1;
1393
        port = -1;
1372
    *p = '\0';
1394
    }
1395
1373
    if (regex) {
1396
    if (regex) {
1374
        reg = ap_pregcomp(cmd->pool, f, AP_REG_EXTENDED);
1397
        reg = ap_pregcomp(cmd->pool, f, AP_REG_EXTENDED);
1375
        if (!reg)
1398
        if (!reg)
1376
            return "Regular expression for ProxyRemoteMatch could not be compiled.";
1399
            return "Regular expression for ProxyRemoteMatch could not be compiled.";
1377
    }
1400
    }
1378
    else
1401
    else if (strchr(f, ':') == NULL) {
1379
        if (strchr(f, ':') == NULL)
1402
        ap_str_tolower(f);   /* lowercase scheme */
1380
            ap_str_tolower(f);      /* lowercase scheme */
1403
    }
1381
    ap_str_tolower(p + 3);      /* lowercase hostname */
1404
    ap_str_tolower(p);       /* lowercase hostname */
1382
1405
1383
    if (port == -1) {
1406
    if (port == -1) {
1384
        port = apr_uri_port_of_scheme(scheme);
1407
        port = apr_uri_port_of_scheme(scheme);
Lines 1387-1394 Link Here
1387
    new = apr_array_push(conf->proxies);
1410
    new = apr_array_push(conf->proxies);
1388
    new->scheme = f;
1411
    new->scheme = f;
1389
    new->protocol = r;
1412
    new->protocol = r;
1390
    new->hostname = p + 3;
1413
    new->hostname = p;
1391
    new->port = port;
1414
    new->port = port;
1415
    new->auth = a;
1392
    new->regexp = reg;
1416
    new->regexp = reg;
1393
    new->use_regex = regex;
1417
    new->use_regex = regex;
1394
    return NULL;
1418
    return NULL;
Lines 2292-2298 Link Here
2292
    AP_INIT_FLAG("ProxyRequests", set_proxy_req, NULL, RSRC_CONF,
2316
    AP_INIT_FLAG("ProxyRequests", set_proxy_req, NULL, RSRC_CONF,
2293
     "on if the true proxy requests should be accepted"),
2317
     "on if the true proxy requests should be accepted"),
2294
    AP_INIT_TAKE2("ProxyRemote", add_proxy_noregex, NULL, RSRC_CONF,
2318
    AP_INIT_TAKE2("ProxyRemote", add_proxy_noregex, NULL, RSRC_CONF,
2295
     "a scheme, partial URL or '*' and a proxy server"),
2319
     "a scheme, partial URL or '*' and a proxy server optional with auth"),
2296
    AP_INIT_TAKE2("ProxyRemoteMatch", add_proxy_regex, NULL, RSRC_CONF,
2320
    AP_INIT_TAKE2("ProxyRemoteMatch", add_proxy_regex, NULL, RSRC_CONF,
2297
     "a regex pattern and a proxy server"),
2321
     "a regex pattern and a proxy server"),
2298
    AP_INIT_FLAG("ProxyPassInterpolateEnv", ap_set_flag_slot_char,
2322
    AP_INIT_FLAG("ProxyPassInterpolateEnv", ap_set_flag_slot_char,
Lines 2655-2662 Link Here
2655
                                     (request_rec *r, proxy_worker *worker,
2679
                                     (request_rec *r, proxy_worker *worker,
2656
                                      proxy_server_conf *conf,
2680
                                      proxy_server_conf *conf,
2657
                                      char *url, const char *proxyhost,
2681
                                      char *url, const char *proxyhost,
2658
                                      apr_port_t proxyport),(r,worker,conf,
2682
                                      apr_port_t proxyport,
2659
                                      url,proxyhost,proxyport),DECLINED)
2683
                                      const char *proxyauth),
2684
                                     (r,worker,conf,
2685
                                      url,proxyhost,proxyport, proxyauth),DECLINED)
2660
APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(proxy, PROXY, int, canon_handler,
2686
APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(proxy, PROXY, int, canon_handler,
2661
                                      (request_rec *r, char *url),(r,
2687
                                      (request_rec *r, char *url),(r,
2662
                                      url),DECLINED)
2688
                                      url),DECLINED)
(-)modules/proxy/mod_proxy_fcgi.c.orig (-2 / +4 lines)
Lines 925-931 Link Here
925
static int proxy_fcgi_handler(request_rec *r, proxy_worker *worker,
925
static int proxy_fcgi_handler(request_rec *r, proxy_worker *worker,
926
                              proxy_server_conf *conf,
926
                              proxy_server_conf *conf,
927
                              char *url, const char *proxyname,
927
                              char *url, const char *proxyname,
928
                              apr_port_t proxyport)
928
                              apr_port_t proxyport,
929
                              const char *proxyauth)
929
{
930
{
930
    int status;
931
    int status;
931
    char server_portstr[32];
932
    char server_portstr[32];
Lines 970-976 Link Here
970
971
971
    /* Step One: Determine Who To Connect To */
972
    /* Step One: Determine Who To Connect To */
972
    status = ap_proxy_determine_connection(p, r, conf, worker, backend,
973
    status = ap_proxy_determine_connection(p, r, conf, worker, backend,
973
                                           uri, &url, proxyname, proxyport,
974
                                           uri, &url, 
975
                                           proxyname, proxyport, proxyauth,
974
                                           server_portstr,
976
                                           server_portstr,
975
                                           sizeof(server_portstr));
977
                                           sizeof(server_portstr));
976
    if (status != OK) {
978
    if (status != OK) {
(-)modules/proxy/mod_proxy_fdpass.c.orig (-1 / +2 lines)
Lines 179-185 Link Here
179
static int proxy_fdpass_handler(request_rec *r, proxy_worker *worker,
179
static int proxy_fdpass_handler(request_rec *r, proxy_worker *worker,
180
                              proxy_server_conf *conf,
180
                              proxy_server_conf *conf,
181
                              char *url, const char *proxyname,
181
                              char *url, const char *proxyname,
182
                              apr_port_t proxyport)
182
                              apr_port_t proxyport,
183
                              const char *proxyauth)
183
{
184
{
184
    apr_status_t rv;
185
    apr_status_t rv;
185
    apr_socket_t *sock;
186
    apr_socket_t *sock;
(-)modules/proxy/mod_proxy_ftp.c.orig (-1 / +2 lines)
Lines 961-967 Link Here
961
 */
961
 */
962
static int proxy_ftp_handler(request_rec *r, proxy_worker *worker,
962
static int proxy_ftp_handler(request_rec *r, proxy_worker *worker,
963
                             proxy_server_conf *conf, char *url,
963
                             proxy_server_conf *conf, char *url,
964
                             const char *proxyhost, apr_port_t proxyport)
964
                             const char *proxyhost, apr_port_t proxyport,
965
                             const char *proxyauth)
965
{
966
{
966
    apr_pool_t *p = r->pool;
967
    apr_pool_t *p = r->pool;
967
    conn_rec *c = r->connection;
968
    conn_rec *c = r->connection;
(-)modules/proxy/mod_proxy_http.c.orig (-4 / +15 lines)
Lines 682-688 Link Here
682
                                   proxy_conn_rec *p_conn, proxy_worker *worker,
682
                                   proxy_conn_rec *p_conn, proxy_worker *worker,
683
                                   proxy_server_conf *conf,
683
                                   proxy_server_conf *conf,
684
                                   apr_uri_t *uri,
684
                                   apr_uri_t *uri,
685
                                   char *url, char *server_portstr)
685
                                   char *url, char *server_portstr,
686
                                   const char *proxyauth) 
686
{
687
{
687
    conn_rec *c = r->connection;
688
    conn_rec *c = r->connection;
688
    apr_bucket_alloc_t *bucket_alloc = c->bucket_alloc;
689
    apr_bucket_alloc_t *bucket_alloc = c->bucket_alloc;
Lines 718-723 Link Here
718
        return rv;
719
        return rv;
719
    }
720
    }
720
721
722
    if (proxyauth) {
723
        buf = apr_pstrcat(p, "Proxy-Authorization: Basic ",
724
                          proxyauth, CRLF, NULL);
725
        ap_xlate_proto_to_ascii(buf, strlen(buf));
726
        e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);
727
        APR_BRIGADE_INSERT_TAIL(header_brigade, e);
728
    } 
729
721
    /* We have headers, let's figure out our request body... */
730
    /* We have headers, let's figure out our request body... */
722
    input_brigade = apr_brigade_create(p, bucket_alloc);
731
    input_brigade = apr_brigade_create(p, bucket_alloc);
723
732
Lines 1849-1855 Link Here
1849
static int proxy_http_handler(request_rec *r, proxy_worker *worker,
1858
static int proxy_http_handler(request_rec *r, proxy_worker *worker,
1850
                              proxy_server_conf *conf,
1859
                              proxy_server_conf *conf,
1851
                              char *url, const char *proxyname,
1860
                              char *url, const char *proxyname,
1852
                              apr_port_t proxyport)
1861
                              apr_port_t proxyport, const char *proxyauth)
1853
{
1862
{
1854
    int status;
1863
    int status;
1855
    char server_portstr[32];
1864
    char server_portstr[32];
Lines 1932-1938 Link Here
1932
        /* Step One: Determine Who To Connect To */
1941
        /* Step One: Determine Who To Connect To */
1933
        if ((status = ap_proxy_determine_connection(p, r, conf, worker, backend,
1942
        if ((status = ap_proxy_determine_connection(p, r, conf, worker, backend,
1934
                                                uri, &locurl, proxyname,
1943
                                                uri, &locurl, proxyname,
1935
                                                proxyport, server_portstr,
1944
                                                proxyport, proxyauth, server_portstr,
1936
                                                sizeof(server_portstr))) != OK)
1945
                                                sizeof(server_portstr))) != OK)
1937
            break;
1946
            break;
1938
1947
Lines 1977-1988 Link Here
1977
            }
1986
            }
1978
        }
1987
        }
1979
1988
1989
1980
        /* Step Four: Send the Request
1990
        /* Step Four: Send the Request
1981
         * On the off-chance that we forced a 100-Continue as a
1991
         * On the off-chance that we forced a 100-Continue as a
1982
         * kinda HTTP ping test, allow for retries
1992
         * kinda HTTP ping test, allow for retries
1983
         */
1993
         */
1984
        if ((status = ap_proxy_http_request(p, r, backend, worker,
1994
        if ((status = ap_proxy_http_request(p, r, backend, worker,
1985
                                        conf, uri, locurl, server_portstr)) != OK) {
1995
                                        conf, uri, locurl, server_portstr, 
1996
                                        (is_ssl ? NULL : proxyauth))) != OK) {
1986
            if ((status == HTTP_SERVICE_UNAVAILABLE) && worker->s->ping_timeout_set) {
1997
            if ((status == HTTP_SERVICE_UNAVAILABLE) && worker->s->ping_timeout_set) {
1987
                backend->close = 1;
1998
                backend->close = 1;
1988
                ap_log_rerror(APLOG_MARK, APLOG_INFO, status, r, APLOGNO(01115)
1999
                ap_log_rerror(APLOG_MARK, APLOG_INFO, status, r, APLOGNO(01115)
(-)modules/proxy/mod_proxy_scgi.c.orig (-2 / +4 lines)
Lines 497-503 Link Here
497
 */
497
 */
498
static int scgi_handler(request_rec *r, proxy_worker *worker,
498
static int scgi_handler(request_rec *r, proxy_worker *worker,
499
                        proxy_server_conf *conf, char *url,
499
                        proxy_server_conf *conf, char *url,
500
                        const char *proxyname, apr_port_t proxyport)
500
                        const char *proxyname, apr_port_t proxyport,
501
                        const char *proxyauth)
501
{
502
{
502
    int status;
503
    int status;
503
    proxy_conn_rec *backend = NULL;
504
    proxy_conn_rec *backend = NULL;
Lines 521-527 Link Here
521
522
522
    /* Step One: Determine Who To Connect To */
523
    /* Step One: Determine Who To Connect To */
523
    status = ap_proxy_determine_connection(p, r, conf, worker, backend,
524
    status = ap_proxy_determine_connection(p, r, conf, worker, backend,
524
                                           uri, &url, proxyname, proxyport,
525
                                           uri, &url, 
526
                                           proxyname, proxyport, proxyauth,
525
                                           &dummy, 1);
527
                                           &dummy, 1);
526
    if (status != OK) {
528
    if (status != OK) {
527
        goto cleanup;
529
        goto cleanup;
(-)modules/proxy/mod_proxy_wstunnel.c.orig (-2 / +4 lines)
Lines 305-311 Link Here
305
static int proxy_wstunnel_handler(request_rec *r, proxy_worker *worker,
305
static int proxy_wstunnel_handler(request_rec *r, proxy_worker *worker,
306
                             proxy_server_conf *conf,
306
                             proxy_server_conf *conf,
307
                             char *url, const char *proxyname,
307
                             char *url, const char *proxyname,
308
                             apr_port_t proxyport)
308
                             apr_port_t proxyport,
309
                             const char *proxyauth)
309
{
310
{
310
    int status;
311
    int status;
311
    char server_portstr[32];
312
    char server_portstr[32];
Lines 349-355 Link Here
349
        char *locurl = url;
350
        char *locurl = url;
350
        /* Step One: Determine Who To Connect To */
351
        /* Step One: Determine Who To Connect To */
351
        status = ap_proxy_determine_connection(p, r, conf, worker, backend,
352
        status = ap_proxy_determine_connection(p, r, conf, worker, backend,
352
                                               uri, &locurl, proxyname, proxyport,
353
                                               uri, &locurl, 
354
                                               proxyname, proxyport, proxyauth,
353
                                               server_portstr,
355
                                               server_portstr,
354
                                               sizeof(server_portstr));
356
                                               sizeof(server_portstr));
355
357
(-)modules/proxy/proxy_util.c.orig (-7 / +21 lines)
Lines 2047-2052 Link Here
2047
                              char **url,
2047
                              char **url,
2048
                              const char *proxyname,
2048
                              const char *proxyname,
2049
                              apr_port_t proxyport,
2049
                              apr_port_t proxyport,
2050
                              const char *proxyauth,
2050
                              char *server_portstr,
2051
                              char *server_portstr,
2051
                              int server_portstr_size)
2052
                              int server_portstr_size)
2052
{
2053
{
Lines 2077-2083 Link Here
2077
     * short living pool.
2078
     * short living pool.
2078
     */
2079
     */
2079
    /* are we connecting directly, or via a proxy? */
2080
    /* are we connecting directly, or via a proxy? */
2080
    if (!proxyname) {
2081
    /* handle HTTP/1.0 via SSL like direct connect */
2082
    if (!proxyname || 
2083
        (conn->is_ssl && 
2084
         apr_table_get(r->subprocess_env, "force-proxy-request-1.0"))) {
2081
        *url = apr_pstrcat(p, uri->path, uri->query ? "?" : "",
2085
        *url = apr_pstrcat(p, uri->path, uri->query ? "?" : "",
2082
                           uri->query ? uri->query : "",
2086
                           uri->query ? uri->query : "",
2083
                           uri->fragment ? "#" : "",
2087
                           uri->fragment ? "#" : "",
Lines 2123-2130 Link Here
2123
                    proxy_auth[0] != '\0' &&
2127
                    proxy_auth[0] != '\0' &&
2124
                    r->user == NULL && /* we haven't yet authenticated */
2128
                    r->user == NULL && /* we haven't yet authenticated */
2125
                    apr_table_get(r->subprocess_env, "Proxy-Chain-Auth")) {
2129
                    apr_table_get(r->subprocess_env, "Proxy-Chain-Auth")) {
2130
                    /* take ProxyAuth from Request */
2126
                    forward->proxy_auth = apr_pstrdup(conn->pool, proxy_auth);
2131
                    forward->proxy_auth = apr_pstrdup(conn->pool, proxy_auth);
2127
                }
2132
                } else if ( proxyauth ) {
2133
                    /* take ProxyAuth from ProxyRemote */
2134
                    forward->proxy_auth = apr_pstrcat(conn->pool, "Basic ", proxyauth, NULL);
2135
		}
2128
            }
2136
            }
2129
        }
2137
        }
2130
        else {
2138
        else {
Lines 2283-2293 Link Here
2283
    forward_info *forward = (forward_info *)backend->forward;
2291
    forward_info *forward = (forward_info *)backend->forward;
2284
    int len = 0;
2292
    int len = 0;
2285
2293
2286
    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00948)
2287
                 "CONNECT: sending the CONNECT request for %s:%d "
2288
                 "to the remote proxy %pI (%s)",
2289
                 forward->target_host, forward->target_port,
2290
                 backend->addr, backend->hostname);
2291
    /* Create the CONNECT request */
2294
    /* Create the CONNECT request */
2292
    nbytes = apr_snprintf(buffer, sizeof(buffer),
2295
    nbytes = apr_snprintf(buffer, sizeof(buffer),
2293
                          "CONNECT %s:%d HTTP/1.0" CRLF,
2296
                          "CONNECT %s:%d HTTP/1.0" CRLF,
Lines 2297-2302 Link Here
2297
        nbytes += apr_snprintf(buffer + nbytes, sizeof(buffer) - nbytes,
2300
        nbytes += apr_snprintf(buffer + nbytes, sizeof(buffer) - nbytes,
2298
                               "Proxy-Authorization: %s" CRLF,
2301
                               "Proxy-Authorization: %s" CRLF,
2299
                               forward->proxy_auth);
2302
                               forward->proxy_auth);
2303
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00948)
2304
                     "CONNECT: sending the CONNECT request for %s:%d "
2305
                     "to the remote proxy %pI (%s) with forward auth \"%s\"",
2306
                     forward->target_host, forward->target_port,
2307
                     backend->addr, backend->hostname, forward->proxy_auth);
2308
    } else {
2309
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00948)
2310
                     "CONNECT: sending the CONNECT request for %s:%d "
2311
                     "to the remote proxy %pI (%s) without auth",
2312
                     forward->target_host, forward->target_port,
2313
                     backend->addr, backend->hostname);
2300
    }
2314
    }
2301
    /* Set a reasonable agent and send everything */
2315
    /* Set a reasonable agent and send everything */
2302
    nbytes += apr_snprintf(buffer + nbytes, sizeof(buffer) - nbytes,
2316
    nbytes += apr_snprintf(buffer + nbytes, sizeof(buffer) - nbytes,

Return to bug 37355