changeset 8848:89b71acdac9a

url: let host port take precedence when connecting to HTTPS Fixes use of HTTPS connections on non-standard ports.
author Henrik Stuart <hg@hstuart.dk>
date Sat, 20 Jun 2009 17:09:49 +0200
parents 7951f385fcb7
children 80cc4b1a62d0
files mercurial/url.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/url.py	Sat Jun 20 10:58:57 2009 +0200
+++ b/mercurial/url.py	Sat Jun 20 17:09:49 2009 +0200
@@ -438,6 +438,12 @@
                 keyfile = self.auth['key']
                 certfile = self.auth['cert']
 
+            # let host port take precedence
+            if ':' in host and '[' not in host or ']:' in host:
+                host, port = host.rsplit(':', 1)
+                if '[' in host:
+                    host = host[1:-1]
+
             return httpsconnection(host, port, keyfile, certfile, *args, **kwargs)
 
 # In python < 2.5 AbstractDigestAuthHandler raises a ValueError if