Squid SSL accelerator patch

From: K. Leif D. Van Horn <leif@dont-contact.us>
Date: Thu, 4 Jan 2001 09:11:36 -0700

Here is a patch to the Squid SSL accelerator headed up by Benno Rice.
This allows me to pass either http://... or https://... to any
redirect programs allowing me to modify the URL accordingly.
I have tested this with a Zope server.

Thanks,
Leif Van Horn
Kaivo, Inc.

--- src/url.c.orig Wed Dec 20 16:51:58 2000
+++ src/url.c Wed Dec 20 17:23:46 2000
@@ -550,12 +550,17 @@
             rc = 1;
         break;
     case PROTO_HTTPS:
+#ifdef USE_SSL
+ rc = 1;
+ break;
+#else
         /*
          * Squid can't originate an SSL connection, so it should
          * never receive an "https:" URL. It should always be
          * CONNECT instead.
          */
         rc = 0;
+#endif
     default:
         break;
     }
--- src/client_side.c.orig Wed Dec 20 12:22:39 2000
+++ src/client_side.c Wed Dec 20 17:28:40 2000
@@ -2398,6 +2398,7 @@
         if (opt_accel_uses_host && (t = mime_get_header(req_hdr, "Host"))) {
             int vport = (int) Config.Accel.port;
             char *q;
+ char *protocol_name = "http";
             /* If a Host: header was specified, use it to build the URL
              * instead of the one in the Config file. */
             /*
@@ -2415,8 +2416,15 @@
             url_sz = strlen(url) + 32 + Config.appendDomainLen +
                 strlen(t);
             http->uri = xcalloc(url_sz, 1);
- snprintf(http->uri, url_sz, "http://%s:%d%s",
- t, vport, url);
+
+#ifdef USE_SSL
+ if (Config.Sockaddr.https->s.sin_port == http->conn->me.sin_port) {
+ protocol_name = "https";
+ vport = ntohs(http->conn->me.sin_port);
+ }
+#endif
+ snprintf(http->uri, url_sz, "%s://%s:%d%s",
+ protocol_name, t, vport, url);
         } else if (vhost_mode) {
             int vport;
             /* Put the local socket IP address as the hostname */
Received on Thu Jan 04 2001 - 09:13:10 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:13:09 MST