Commit 9b8a3542 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Deal with port sillyness (:443).

parent 7e2b4134
......@@ -11,6 +11,9 @@
# CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
# FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
from urlparse import urlsplit, urlunsplit
from urllib import splitport
HOME = os.environ["HOME"]
# Path to my certificate
CERTIFICATE = HOME + "/.ssl/encrypted.pem"
......@@ -75,9 +78,18 @@ def do_method(module, method, params, URI=None):
path = SERVER_PATH[ "default" ]
URI = "https://" + addr + path + module
else:
elif module:
URI = URI + "/" + module
pass
scheme, netloc, path, query, fragment = urlsplit(URI)
if scheme == "https":
host,port = splitport(netloc)
if not port:
netloc = netloc + ":443"
URI = urlunsplit((scheme, netloc, path, query, fragment));
pass
pass
ctx = SSL.Context("sslv23")
ctx.load_cert(CERTIFICATE, CERTIFICATE, PassPhraseCB)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment