summaryrefslogtreecommitdiffstats
path: root/Doc/library/ssl.rst
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-06-22 19:11:52 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-06-22 19:11:52 (GMT)
commit3b36fb1f537a771829c9c7c9720dc040d3c87885 (patch)
treeaaec4c06b55dfb3681c56be22fe1112a79d3c433 /Doc/library/ssl.rst
parent31227ca5148436ee3e48430814c59fc31876821d (diff)
downloadcpython-3b36fb1f537a771829c9c7c9720dc040d3c87885.zip
cpython-3b36fb1f537a771829c9c7c9720dc040d3c87885.tar.gz
cpython-3b36fb1f537a771829c9c7c9720dc040d3c87885.tar.bz2
Issue #14837: SSL errors now have `library` and `reason` attributes describing precisely what happened and in which OpenSSL submodule.
The str() of a SSLError is also enhanced accordingly. NOTE: this commit creates a reference leak. The leak seems tied to the use of PyType_FromSpec() to create the SSLError type. The leak is on the type object when it is instantiated: >>> e = ssl.SSLError() >>> sys.getrefcount(ssl.SSLError) 35 >>> e = ssl.SSLError() >>> sys.getrefcount(ssl.SSLError) 36 >>> e = ssl.SSLError() >>> sys.getrefcount(ssl.SSLError) 37
Diffstat (limited to 'Doc/library/ssl.rst')
-rw-r--r--Doc/library/ssl.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index 8092581..e08c2b9 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -59,6 +59,22 @@ Functions, Constants, and Exceptions
.. versionchanged:: 3.3
:exc:`SSLError` used to be a subtype of :exc:`socket.error`.
+ .. attribute:: library
+
+ A string mnemonic designating the OpenSSL submodule in which the error
+ occurred, such as ``SSL``, ``PEM`` or ``X509``. The range of possible
+ values depends on the OpenSSL version.
+
+ .. versionadded:: 3.3
+
+ .. attribute:: reason
+
+ A string mnemonic designating the reason this error occurred, for
+ example ``CERTIFICATE_VERIFY_FAILED``. The range of possible
+ values depends on the OpenSSL version.
+
+ .. versionadded:: 3.3
+
.. exception:: SSLZeroReturnError
A subclass of :exc:`SSLError` raised when trying to read or write and