summaryrefslogtreecommitdiffstats
path: root/src/lib/Proxy.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2011-06-22 17:01:40 -0500
committerNarayan Desai <desai@mcs.anl.gov>2011-06-22 17:01:40 -0500
commit4849378a62ab0dbf72f8ce4e6b2073dc73f2337a (patch)
tree14945dd6045c438f5dbc8e96f023258d31e1adf9 /src/lib/Proxy.py
parent8d08d5195fa0b6f503752273183948e5d24f33d6 (diff)
parent2db056574f5f55c3c802da63abe7e3de10db5d76 (diff)
downloadbcfg2-4849378a62ab0dbf72f8ce4e6b2073dc73f2337a.tar.gz
bcfg2-4849378a62ab0dbf72f8ce4e6b2073dc73f2337a.tar.bz2
bcfg2-4849378a62ab0dbf72f8ce4e6b2073dc73f2337a.zip
Merge branch 'master' of git.mcs.anl.gov:bcfg2
Diffstat (limited to 'src/lib/Proxy.py')
-rw-r--r--src/lib/Proxy.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/Proxy.py b/src/lib/Proxy.py
index 8a1ad683e..4cb0bbe80 100644
--- a/src/lib/Proxy.py
+++ b/src/lib/Proxy.py
@@ -47,6 +47,9 @@ __all__ = ["ComponentProxy",
class CertificateError(Exception):
def __init__(self, commonName):
self.commonName = commonName
+ def __str__(self):
+ return ("Got unallowed commonName %s from server"
+ % self.commonName)
class RetryMethod(xmlrpclib._Method):
@@ -181,7 +184,7 @@ class SSLHTTPConnection(httplib.HTTPConnection):
other_side_required = ssl.CERT_NONE
self.logger.warning("No ca is specified. Cannot authenticate the server with SSL.")
if self.cert and not self.key:
- self.logger.warning("SSL cert specfied, but key. Cannot authenticate this client with SSL.")
+ self.logger.warning("SSL cert specfied, but no key. Cannot authenticate this client with SSL.")
self.cert = None
if self.key and not self.cert:
self.logger.warning("SSL key specfied, but no cert. Cannot authenticate this client with SSL.")
@@ -226,7 +229,7 @@ class SSLHTTPConnection(httplib.HTTPConnection):
# authentication to the server
ctx.load_cert(self.cert, self.key)
elif self.cert:
- self.logger.warning("SSL cert specfied, but key. Cannot authenticate this client with SSL.")
+ self.logger.warning("SSL cert specfied, but no key. Cannot authenticate this client with SSL.")
elif self.key:
self.logger.warning("SSL key specfied, but no cert. Cannot authenticate this client with SSL.")
@@ -332,5 +335,5 @@ def ComponentProxy(url, user=None, password=None,
else:
newurl = url
ssl_trans = XMLRPCTransport(key, cert, ca,
- allowedServerCNs, timeout=timeout)
+ allowedServerCNs, timeout=float(timeout))
return xmlrpclib.ServerProxy(newurl, allow_none=True, transport=ssl_trans)