diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -1588,8 +1588,17 @@ Notes on non-blocking sockets ----------------------------- -When working with non-blocking sockets, there are several things you need -to be aware of: +SSL sockets behave slightly different than regular sockets in +non-blocking mode. When working with non-blocking sockets, there are +thus several things you need to be aware of: + +- Most :class:`SSLSocket` methods will raise either + :exc:`SSLWantWriteError` or :exc:`SSLWantReadError` instead of + :exc:`BlockingIOError` if an I/O operation would + block. However, **the** :meth:`SSLSocket.send` **method returns zero in + this situation** instead of raising any exception (this behavior is + mostly a historical accident that has not bene changed for + backwards compatibility reasons). - Calling :func:`~select.select` tells you that the OS-level socket can be read from (or written to), but it does not imply that there is sufficient @@ -1615,7 +1624,8 @@ except ssl.SSLWantWriteError: select.select([], [sock], []) - + + .. _ssl-security: Security considerations