Index: fedd/federation/remote_service.py
===================================================================
--- fedd/federation/remote_service.py	(revision 6a8a9ec540145f64bc7f0bdd03940ababd39c500)
+++ fedd/federation/remote_service.py	(revision 8e6fe4dbe8004d48825d896354ee09ffb11af283)
@@ -298,4 +298,5 @@
 	self.tracefile = tracefile
 	self.__call__ = self.call_service
+	self.max_retries = 5
 
     def serialize_soap(self, req):
@@ -343,22 +344,31 @@
 	port = ServerProxy(url, transport=transport)
 	# Make the call, and convert faults back to service_errors
-	try:
-	    remote_method = getattr(port, self.service_name, None)
-	    if self.request_body_name:
-		resp = remote_method(self.apply_to_tags(\
-			{ self.request_body_name: r}, self.encap_fedids))
-	    else:
-		resp = remote_method(self.apply_to_tags(r, self.encap_fedids))
-	except socket_error, e:
-	    raise service_error(service_error.connect, 
-		    "Cannot connect to %s: %s" % (url, e[1]))
-	except SSLError, e:
-	    raise service_error(service_error.connect,
-		    "SSL error contacting %s: %s" % (url, e.message))
-	except Fault, f:
-	    raise service_error(f.faultCode, f.faultString)
-	except Error, e:
-	    raise service_error(service_error.protocol, 
-		    "Remote XMLRPC Fault: %s" % e)
+	if self.request_body_name:
+	    r  = self.apply_to_tags(\
+		    { self.request_body_name: r}, self.encap_fedids)
+	else:
+	    r = self.apply_to_tags(r, self.encap_fedids)
+
+	ok = False
+	retries = 0
+
+	while not ok and retries < self.max_retries:
+	    try:
+		remote_method = getattr(port, self.service_name, None)
+		resp = remote_method(r)
+	    except socket_error, e:
+		raise service_error(service_error.connect, 
+			"Cannot connect to %s: %s" % (url, e[1]))
+	    except SSLError, e:
+		print "SSL error contacting %s: %s" % (url, e.message)
+		retries += 1
+	    except Fault, f:
+		raise service_error(f.faultCode, f.faultString)
+	    except Error, e:
+		raise service_error(service_error.protocol, 
+			"Remote XMLRPC Fault: %s" % e)
+
+	if retries > self.max_retries :
+	    raise service_error(req.connect, "Too many SSL failures")
 
 	return self.apply_to_tags(resp, self.decap_fedids) 
@@ -413,24 +423,34 @@
 			    self.request_body_name)
 	set_element(self.pack_soap(msg, self.request_body_name, req))
-	try:
-	    resp = remote_method(msg)
-	except socket_error, e:
-	    raise service_error(service_error.connect, 
-		    "Cannot connect to %s: %s" % (url, e[1]))
-	except SSLError, e:
-	    raise service_error(service_error.connect,
-		    "SSL error contacting %s: %s" % (url, e.message))
-	except ParseException, e:
-	    raise service_error(service_error.protocol,
-		    "Bad format message (XMLRPC??): %s" % e)
-	except FaultException, e:
-	    ee = self.unpack_soap(e.fault.detail[0]).get('FeddFaultBody', { })
-	    if ee:
-		raise service_error(ee['code'], ee['desc'])
-	    else:
-		raise service_error(service_error.internal,
-			"Unexpected fault body")
+	ok = False
+	retries = 0
+	while not ok and retries < self.max_retries:
+	    try:
+		resp = remote_method(msg)
+		ok = True
+	    except socket_error, e:
+		raise service_error(service_error.connect, 
+			"Cannot connect to %s: %s" % (url, e[1]))
+	    except SSLError, e:
+		print "SSL error contacting %s: %s" % (url, e.message)
+		retries += 1
+	    except ParseException, e:
+		raise service_error(service_error.protocol,
+			"Bad format message (XMLRPC??): %s" % e)
+	    except FaultException, e:
+		ee = self.unpack_soap(e.fault.detail[0]).get('FeddFaultBody',
+			{ })
+		if ee:
+		    raise service_error(ee['code'], ee['desc'])
+		else:
+		    raise service_error(service_error.internal,
+			    "Unexpected fault body")
+
+	if retries > self.max_retries :
+	    raise service_error(req.connect, "Too many SSL failures")
+
 	# Unpack and convert fedids to objects
 	r = self.apply_to_tags(self.unpack_soap(resp), self.fedid_to_object)
+
 	#  Make sure all strings are unicode
 	r = self.make_unicode(r)
