diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-09-29 17:50:53 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-09-29 17:50:53 (GMT) |
commit | 20b85557f2cc8f5f10d7d98314a3181c60553e12 (patch) | |
tree | 80ad5b16d5f0644f096a284d0b43fedb13630b21 /Doc/library/ssl.rst | |
parent | cf892ace48721cb301d6f8d56ad8779bc13cb9de (diff) | |
download | cpython-20b85557f2cc8f5f10d7d98314a3181c60553e12.zip cpython-20b85557f2cc8f5f10d7d98314a3181c60553e12.tar.gz cpython-20b85557f2cc8f5f10d7d98314a3181c60553e12.tar.bz2 |
Issue #19095: SSLSocket.getpeercert() now raises ValueError when the SSL handshake hasn't been done.
Diffstat (limited to 'Doc/library/ssl.rst')
-rw-r--r-- | Doc/library/ssl.rst | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index 983c144..bb4ceca 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -659,7 +659,8 @@ SSL sockets also have the following additional methods and attributes: .. method:: SSLSocket.getpeercert(binary_form=False) If there is no certificate for the peer on the other end of the connection, - returns ``None``. + return ``None``. If the SSL handshake hasn't been done yet, raise + :exc:`ValueError`. If the ``binary_form`` parameter is :const:`False`, and a certificate was received from the peer, this method returns a :class:`dict` instance. If the @@ -716,6 +717,9 @@ SSL sockets also have the following additional methods and attributes: The returned dictionary includes additional items such as ``issuer`` and ``notBefore``. + .. versionchanged:: 3.4 + :exc:`ValueError` is raised when the handshake isn't done. + .. method:: SSLSocket.cipher() Returns a three-value tuple containing the name of the cipher being used, the |