summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Aurich <paul@darkrain42.org>2015-01-08 08:36:53 -0800
committerPaul Aurich <paul@darkrain42.org>2015-01-08 08:36:53 -0800
commitbff1d1ae72e743e41254bb31a5b50b5b63a37b85 (patch)
treee22187653d4f9716b484d3182828f1f49f6a5abc
parentc85e08616dc7c18f4f24c808f39fcf22d2cce487 (diff)
downloadpyopenssl-bff1d1ae72e743e41254bb31a5b50b5b63a37b85.tar.gz
Fixes #91 -- proper error handling in Connection.shutdown
On error (return < 0), the OpenSSL documentation says to call SSL_get_error to discover the cause, as the act of trying to shutdown may raise lower-level errors (e.g. socket errors), or return SSL_ERR_WANT_WRITE or SSL_ERR_WANT_READ.
-rw-r--r--OpenSSL/SSL.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/OpenSSL/SSL.py b/OpenSSL/SSL.py
index 7b1cbc1..b6c8076 100644
--- a/OpenSSL/SSL.py
+++ b/OpenSSL/SSL.py
@@ -1183,8 +1183,7 @@ class Connection(object):
"""
result = _lib.SSL_shutdown(self._ssl)
if result < 0:
- # TODO: This is untested.
- _raise_current_error()
+ self._raise_ssl_error(self._ssl, result)
elif result > 0:
return True
else: