[PATCH] Don't retry on SSL failures
Dennis Gilmore
dennis at ausil.us
Fri Jul 10 17:52:19 UTC 2015
On Friday, June 12, 2015 11:26:34 PM Mathieu Bridon wrote:
> From: Mathieu Bridon <bochecha at daitauha.fr>
>
> With the current code, trying to SSL-login with a bad certificate will
> just make it look like the client code is hanging.
>
> That's because it tries and tries again, silently, until it reaches it's
> maximum retry limit.
>
> But in the case of an SSL error, such as an expired client cert, there's
> really no point in retrying.
> ---
> koji/__init__.py | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/koji/__init__.py b/koji/__init__.py
> index 58971da..9ebe83a 100644
> --- a/koji/__init__.py
> +++ b/koji/__init__.py
> @@ -57,7 +57,7 @@ import xmlrpclib
> import xml.sax
> import xml.sax.handler
> from xmlrpclib import loads, dumps, Fault
> -#import OpenSSL.SSL
> +import OpenSSL
> import zipfile
>
> def _(args):
> @@ -1938,6 +1938,9 @@ class ClientSession(object):
> except (SystemExit, KeyboardInterrupt):
> #(depending on the python version, these may or may not
> be subclasses of Exception) raise
> + except OpenSSL.SSL.Error as e:
> + # There's no point in retrying this
> + raise
> except Exception, e:
> self._close_connection()
> if not self.logged_in:
Applied, thanks
Dennis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.fedoraproject.org/pipermail/buildsys/attachments/20150710/6b2f6b7b/attachment.sig>
More information about the buildsys
mailing list