]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4293: wrong SNI sent to server after URL-rewrite
authorAlex Wu <alex_wu2012@hotmail.com>
Sat, 1 Aug 2015 03:50:37 +0000 (20:50 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 1 Aug 2015 03:50:37 +0000 (20:50 -0700)
ChangeLog
src/ssl/PeerConnector.cc

index e82c2f01be5c0771b3d8424c4e463a07f7e0166d..affee9d18fe857961c7817662e49c2283a385a35 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 Changes to squid-3.5.7 (01 Aug 2015):
 
+       - Bug 4293: wrong SNI sent to server after URL-rewrite
        - Bug 4251: incorrect instance name for memory segments in /dev/shm
        - Bug 4227: invalid key in AuthUserHashPointer causing assertation failure
        - Bug 3345: support %un (any available user name) format code for external ACLs.
index c4d53fabbe423e2a7871f24ffa56887128535118..10c7ed6e47cf46067d392e8680a96b6d336dbc2d 100644 (file)
@@ -678,8 +678,13 @@ Ssl::PeekingPeerConnector::initializeSsl()
 
             // Use SNI TLS extension only when we connect directly
             // to the origin server and we know the server host name.
-            const char *sniServer = hostName ? hostName->c_str() :
-                                    (!request->url.hostIsNumeric() ? request->url.host() : NULL);
+            const char *sniServer = NULL;
+            const bool redirected = request->flags.redirected && ::Config.onoff.redir_rewrites_host;
+            if (!hostName || redirected)
+                sniServer = !request->url.hostIsNumeric() ? request->url.host() : NULL;
+            else
+                sniServer = hostName->c_str();
+
             if (sniServer)
                 Ssl::setClientSNI(ssl, sniServer);
         }