Subject: Re: Apache 1.3.26 and mod_ssl

From: "James Bromberger" <[email-masked]>
Date: Wed, 19 Jun 2002 08:30:59 +0800

Seems that the current 2.8.8 has some problems patching into some of
the mod_proxy code:

./ap/Makefile.tmpl.rej
./modules/proxy/mod_proxy.c.rej
./modules/proxy/proxy_http.c.rej

Apart from those three files (536 bytes, 1312 bytes, 2607 bytes) it
looks clean...

	James

-- 
  James Bromberger,
  Senior Web/Systems Administrator, JDV
  +61 8 9268 2909, +61 417 322 500
  Fax: +61 8 9266 0200

http://conf.linux.org.au/

>>> [email-masked] 06/19/02 07:54am >>>
On Tue, 18 Jun 2002, Matthew Ruzicka wrote:

> Pardon my possible ignorance here, but has anyone come up with any
good
> work arounds for getting mod_ssl to work with the (patched) Apache
1.3.26
> since 2.8.8-1.3.24 only wants to work with 1.3.24?

I'm looking into it.

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org

User Support Mailing List                      [email-masked]

Automated List Manager                            [email-masked]

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [email-masked]
Automated List Manager                            [email-masked]

---

From: Cliff Woolley <[email-masked]>
Date: Tue, 18 Jun 2002 20:47:11 -0400 (EDT)

> ./modules/proxy/proxy_http.c.rej

hmmmm... wonder why I didn't notice those before?  Sigh.  Anyway,
attached is a patch (totally untested!) which *should* replace the
missing part of the mod_ssl patch.  So after you've run ./configure
--force, apply this patch by going to the apache_1.3.26/ directory and
running "patch -p0 < modssl-2.8.8-1.3.26-fixup.patch".  Let me know if it
works or breaks.  ;)

--Cliff
--- ./src/ap/Makefile.tmpl-1.3.26	Tue Jun 18 20:32:48 2002
+++ ./src/ap/Makefile.tmpl	Tue Jun 18 20:33:18 2002
@@ -7,7 +7,7 @@
 
 OBJS=ap_cpystrn.o ap_execve.o ap_fnmatch.o ap_getpass.o ap_md5c.o ap_signal.o \
      ap_slack.o ap_snprintf.o ap_sha1.o ap_checkpass.o ap_base64.o ap_ebcdic.o \
-     ap_strtol.o
+     ap_strtol.o ap_hook.o ap_ctx.o ap_mm.o
 
 .c.o:
 	$(CC) -c $(INCLUDES) $(CFLAGS) $<
--- ./src/modules/proxy/mod_proxy.c-1.3.26	Tue Jun 18 20:34:15 2002
+++ ./src/modules/proxy/mod_proxy.c	Tue Jun 18 20:36:36 2002
@@ -454,6 +454,14 @@
      */
 
     /* handle the scheme */
+#ifdef EAPI
+    if (ap_hook_use("ap::mod_proxy::handler",
+                    AP_HOOK_SIG7(int,ptr,ptr,ptr,ptr,int,ptr),
+                    AP_HOOK_DECLINE(DECLINED),
+                    &rc, r, cr, url, 
+                    NULL, 0, scheme) && rc != DECLINED)
+        return rc;
+#endif /* EAPI */
     if (r->method_number == M_CONNECT) {
         return ap_proxy_connect_handler(r, cr, url, NULL, 0);
     }
@@ -1051,4 +1059,10 @@
     NULL,                       /* child_init */
     NULL,                       /* child_exit */
     proxy_detect                /* post read-request */
+#ifdef EAPI
+   ,proxy_addmod,		/* EAPI: add_module */
+    proxy_remmod,		/* EAPI: remove_module */
+    NULL,			/* EAPI: rewrite_command */
+    NULL			/* EAPI: new_connection  */
+#endif
 };
--- ./src/modules/proxy/proxy_http.c-1.3.26	Tue Jun 18 20:37:07 2002
+++ ./src/modules/proxy/proxy_http.c	Tue Jun 18 20:40:36 2002
@@ -170,6 +170,9 @@
     const char *datestr, *urlstr;
     int result, major, minor;
     const char *content_length;
+#ifdef EAPI
+    char *peer;
+#endif
 
     void *sconf = r->server->module_config;
     proxy_server_conf *conf =
@@ -320,14 +323,43 @@
     f = ap_bcreate(p, B_RDWR | B_SOCKET);
     ap_bpushfd(f, sock, sock);
 
+#ifdef EAPI
+    {
+        char *errmsg = NULL;
+        ap_hook_use("ap::mod_proxy::http::handler::new_connection", 
+                    AP_HOOK_SIG4(ptr,ptr,ptr,ptr), 
+                    AP_HOOK_DECLINE(NULL),
+                    &errmsg, r, f, peer);
+        if (errmsg != NULL)
+            return ap_proxyerror(r, HTTP_BAD_GATEWAY, errmsg);
+    }
+#endif /* EAPI */
+
     ap_hard_timeout("proxy send", r);
     ap_bvputs(f, r->method, " ", proxyhost ? url : urlptr, " HTTP/1.1" CRLF,
               NULL);
+
+#ifdef EAPI
+    {
+        int rc = DECLINED;
+        ap_hook_use("ap::mod_proxy::http::handler::write_host_header", 
+                    AP_HOOK_SIG6(int,ptr,ptr,ptr,int,ptr), 
+                    AP_HOOK_DECLINE(DECLINED),
+                    &rc, r, f, desthost, destport, destportstr);
+        if (rc == DECLINED) {
+            if (destportstr != NULL && destport != DEFAULT_HTTP_PORT)
+                ap_bvputs(f, "Host: ", desthost, ":", destportstr, CRLF, NULL);
+            else
+		ap_bvputs(f, "Host: ", desthost, CRLF, NULL);
+        }
+    }
+#else /* EAPI */
     /* Send Host: now, adding it to req_hdrs wouldn't be much better */
     if (destportstr != NULL && destport != DEFAULT_HTTP_PORT)
         ap_bvputs(f, "Host: ", desthost, ":", destportstr, CRLF, NULL);
     else
         ap_bvputs(f, "Host: ", desthost, CRLF, NULL);
+#endif
 
     if (conf->viaopt == via_block) {
         /* Block all outgoing Via: headers */

---

From: Udo Schweigert <[email-masked]>
Date: Wed, 19 Jun 2002 08:50:01 +0200

> running "patch -p0 < modssl-2.8.8-1.3.26-fixup.patch".  Let me know if it

Works! 

Many thanks.

--
Udo Schweigert, Siemens AG   | Voice      : +49 89 636 42170
CT IC CERT, Siemens CERT     | Fax        : +49 89 636 41166
D-81730 Muenchen / Germany   | email      : [email-masked]
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [email-masked]
Automated List Manager                            [email-masked]