from ganeti import http
from ganeti import compat
+from ganeti import netutils
class HttpClientRequest(object):
"""Returns the full URL for this requests.
"""
+ if netutils.IPAddress.IsValid(self.host):
+ address = netutils.FormatAddress((self.host, self.port))
+ else:
+ address = "%s:%s" % (self.host, self.port)
# TODO: Support for non-SSL requests
- return "https://%s:%s%s" % (self.host, self.port, self.path)
+ return "https://%s%s" % (address, self.path)
@property
def identity(self):
curl.setopt(pycurl.USERAGENT, http.HTTP_GANETI_VERSION)
curl.setopt(pycurl.PROXY, "")
+ # Disable SSL session ID caching (pycurl >= 7.16.0)
+ if hasattr(pycurl, "SSL_SESSIONID_CACHE"):
+ curl.setopt(pycurl.SSL_SESSIONID_CACHE, False)
+
# Pass cURL object to external config function
if curl_config_fn:
curl_config_fn(curl)