summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Spura <tomspur@fedoraproject.org>2010-07-16 20:49:40 +0200
committerJesse Keating <jkeating@redhat.com>2010-07-23 17:02:22 -0700
commitcf45e69f51900ead51033330a2cf9c56a61759fb (patch)
tree7075dad0cc57c3fc8607a2c8e36e2c9754f70813
parent4a175d2f9c2ac740201f166d5b94488558e2f1ae (diff)
downloadfedora-packager-cf45e69f51900ead51033330a2cf9c56a61759fb.tar.gz
fedora-packager-cf45e69f51900ead51033330a2cf9c56a61759fb.tar.xz
fedora-packager-cf45e69f51900ead51033330a2cf9c56a61759fb.zip
When SSL connection fails, print it on screen.
E.g. when the handshake fails, because your certificate is too old, fedpkg will gracefully fail and not completely crash. Signed-off-by: Thomas Spura <tomspur@fedoraproject.org>
-rw-r--r--src/pyfedpkg/__init__.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index 2086dce..dc4218a 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -1048,8 +1048,12 @@ class PackageModule:
# save the weburl for later use too
self.kojiweburl = defaults['weburl']
# log in using ssl
- self.kojisession.ssl_login(defaults['cert'], defaults['ca'],
- defaults['serverca'])
+ import OpenSSL
+ try:
+ self.kojisession.ssl_login(defaults['cert'], defaults['ca'],
+ defaults['serverca'])
+ except OpenSSL.SSL.Error:
+ raise FedpkgError('Opening a SSL connection failed')
if not self.kojisession.logged_in:
raise FedpkgError('Could not auth with koji as %s' % user)
return