summaryrefslogtreecommitdiff
path: root/swiftclient
diff options
context:
space:
mode:
authorTim Burke <tim.burke@gmail.com>2023-03-17 16:14:15 -0700
committerTim Burke <tim.burke@gmail.com>2023-03-20 16:57:15 -0700
commit099dd66265dfdc94e162eba4c1ec3a33b305bc26 (patch)
tree94dd482d6a87d28ef7e03d9e017b5a08e8c24f83 /swiftclient
parent779cf7484e44855ddbf6f29d48af79104e42a0a6 (diff)
downloadpython-swiftclient-099dd66265dfdc94e162eba4c1ec3a33b305bc26.tar.gz
Retry on SSLError
...provided it isn't something to do with certification validation. Closes-Bug: #1641363 Closes-Bug: #2011731 Change-Id: Ic3acbf431e444fcd8bc0fe79571fe2db4140cf22
Diffstat (limited to 'swiftclient')
-rw-r--r--swiftclient/client.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py
index b9f12aa..0635090 100644
--- a/swiftclient/client.py
+++ b/swiftclient/client.py
@@ -1798,8 +1798,13 @@ class Connection:
service_token=self.service_token, **kwargs)
self._add_response_dict(caller_response_dict, kwargs)
return rv
- except SSLError:
- raise
+ except SSLError as e:
+ self._add_response_dict(caller_response_dict, kwargs)
+ if ('certificate verify' in str(e)) or \
+ ('hostname' in str(e)) or \
+ self.attempts > self.retries:
+ raise
+ self.http_conn = None
except (socket.error, RequestException):
self._add_response_dict(caller_response_dict, kwargs)
if self.attempts > self.retries: