summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/sslproto.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] gh-109534: fix reference leak when SSL handshake fails (GH-114074) ↵Miss Islington (bot)2024-02-011-0/+1
| | | | | | | | (#114830) gh-109534: fix reference leak when SSL handshake fails (GH-114074) (cherry picked from commit 80aa7b3688b8fdc85cd53d4113cb5f6ce5500027) Co-authored-by: Jamie Phan <jamie@ordinarylab.dev>
* [3.11] gh-95649: Document that asyncio contains uvloop code (GH-107536) ↵Alois Klink2024-01-141-0/+4
| | | | | | | | | | | | (#114045) Some of the asyncio SSL changes in GH-31275 [1] were taken from v0.16.0 of the uvloop project [2]. In order to comply with the MIT license, we need to just need to document the copyright information. [1]: https://github.com/python/cpython/pull/31275 [2]: https://github.com/MagicStack/uvloop/tree/v0.16.0 (cherry picked from commit dce30c9cbc212e5455e100f35ac6afeb30dfd23e)
* [3.11] GH-113214: Fix SSLProto exception handling in SSL-over-SSL scenarios ↵Miss Islington (bot)2023-12-211-7/+6
| | | | | | | | | | | (GH-113334) (#113340) When wrapped, `_SSLProtocolTransport._force_close(exc)` is called just like in the unwrapped scenario `_SelectorTransport._force_close(exc)` or `_ProactorBasePipeTransport._force_close(exc)` would be called, except here the exception needs to be passed through the `SSLProtocol._abort()` method, which didn't accept an exception object. This commit ensures that this path works, in the same way that the uvloop implementation of SSLProto passes on the exception (on which the current implementation of SSLProto is based). (cherry picked from commit 1ff02385944924db7e683a607da2882462594764) Co-authored-by: Martijn Pieters <mj@zopatista.com>
* [3.11] gh-98539: Make _SSLTransportProtocol.abort() safe to call when closed ↵Miss Islington (bot)2023-05-141-1/+2
| | | | | | | (GH-104474) (#104485) (cherry picked from commit fb8739f0b6291fb048a94d6312f59ba4d10a20ca) Co-authored-by: Sam Bull <git@sambull.org>
* [3.11] gh-99277: remove older version of `get_write_buffer_limits` ↵Miss Islington (bot)2022-11-101-6/+0
| | | | | | | | | (GH-99280) (#99338) (cherry picked from commit f1680c3fbf7d18a1b3a5b390c433298bb6b9fcac) Co-authored-by: Carlo <34414634+csuriano23@users.noreply.github.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.11] GH-98539: fix ref cycle in `_SSLProtocolTransport` after close ↵Miss Islington (bot)2022-10-241-2/+5
| | | | | | | | (GH-98540) (#98551) GH-98539: fix ref cycle in `_SSLProtocolTransport` after close (GH-98540) (cherry picked from commit 62bf5d8d0a36112619436a813ceefb7e4af52c24) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* Remove trailing spaces (GH-31695)Serhiy Storchaka2022-03-051-2/+2
|
* bpo-44011: New asyncio ssl implementation (#31275)Kumar Aditya2022-02-151-437/+622
| | | | | | | | | | | * bpo-44011: New asyncio ssl implementation Co-Authored-By: Andrew Svetlov <andrew.svetlov@gmail.com> * fix warning * fix typo Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-46487: Add `get_write_buffer_limits` to Write and _SSLProtocol ↵Emiya2022-02-011-0/+6
| | | | | transports (GH-30958) Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-44011: Revert "New asyncio ssl implementation (GH-17975)" (GH-25848)Pablo Galindo2021-05-031-622/+437
| | | | This reverts commit 5fb06edbbb769561e245d0fe13002bab50e2ae60 and all subsequent dependent commits.
* bpo-44011: Fix asyncio tests without ssl module (GH-25840)Christian Heimes2021-05-031-1/+2
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-44011: New asyncio ssl implementation (#17975)Andrew Svetlov2021-05-021-437/+621
|
* bpo-40443: Remove unused imports in the stdlib (GH-19803)Victor Stinner2020-04-301-1/+0
|
* bpo-37035: Don't log OSError (GH-13548)Andrew Svetlov2019-05-271-1/+1
| | | https://bugs.python.org/issue37035
* bpo-32528: Make asyncio.CancelledError a BaseException. (GH-13528)Yury Selivanov2019-05-271-4/+12
| | | | | | | | | | | | | | | This will address the common mistake many asyncio users make: an "except Exception" clause breaking Tasks cancellation. In addition to this change, we stop inheriting asyncio.TimeoutError and asyncio.InvalidStateError from their concurrent.futures.* counterparts. There's no point for these exceptions to share the inheritance chain. In 3.9 we'll focus on implementing supervisors and cancel scopes, which should allow better handling of all exceptions, including SystemExit and KeyboardInterrupt
* bpo-34745: Fix asyncio sslproto memory issues (GH-12386)Fantix King2019-03-171-0/+4
| | | | | | | | | | | | | | * Fix handshake timeout leak in asyncio/sslproto Refs MagicStack/uvloop#222 * Break circular ref _SSLPipe <-> SSLProtocol * bpo-34745: Fix asyncio ssl memory leak * Break circular ref SSLProtocol <-> UserProtocol * Add NEWS entry
* asyncio: __del__() keep reference to warnings.warn (GH-11491)Victor Stinner2019-01-101-3/+2
| | | | | | | | | | | | | | | * asyncio: __del__() keep reference to warnings.warn The __del__() methods of asyncio classes now keep a strong reference to the warnings.warn() to be able to display the ResourceWarning warning in more cases. Ensure that the function remains available if instances are destroyed late during Python shutdown (while module symbols are cleared). * Rename warn parameter to _warn "_warn" name is a hint that it's not the regular warnings.warn() function.
* bpo-33694: Fix typo in helper function name (GH-7522)Victor Stinner2018-06-081-1/+1
| | | | | | _feed_data_to_bufferred_proto() renamed to _feed_data_to_buffered_proto() ("bufferred" => "buffered"). Typo spotted by Nathaniel J. Smith.
* bpo-33694: Fix race condition in asyncio proactor (GH-7498)Victor Stinner2018-06-071-20/+1
| | | | | | | | | | | | | | | | The cancellation of an overlapped WSARecv() has a race condition which causes data loss because of the current implementation of proactor in asyncio. No longer cancel overlapped WSARecv() in _ProactorReadPipeTransport to work around the race condition. Remove the optimized recv_into() implementation to get simple implementation of pause_reading() using the single _pending_data attribute. Move _feed_data_to_bufferred_proto() to protocols.py. Remove set_protocol() method which became useless.
* bpo-33769: start_tls: Fix error message; cancel callbacks on error (GH-7403)Yury Selivanov2018-06-051-0/+1
| | | In addition to that, mark SSLTransport as "closed" in its "abort()" method to prevent bogus warnings.
* bpo-33734: asyncio/ssl: a bunch of bugfixes (#7321)Yury Selivanov2018-06-041-32/+29
| | | | | | | * Fix AttributeError (not all SSL exceptions have 'errno' attribute) * Increase default handshake timeout from 10 to 60 seconds * Make sure start_tls can be cancelled correctly * Make sure any error in SSLProtocol gets propagated (instead of just being logged)
* bpo-33654: Support protocol type switching in SSLTransport.set_protocol() ↵Yury Selivanov2018-05-291-4/+7
| | | | (#7194)
* bpo-33674: asyncio: Fix SSLProtocol race (GH-7175)Victor Stinner2018-05-281-1/+1
| | | | | | Fix a race condition in SSLProtocol.connection_made() of asyncio.sslproto: start immediately the handshake instead of using call_soon(). Previously, data_received() could be called before the handshake started, causing the handshake to hang or fail.
* bpo-33654: Support BufferedProtocol in set_protocol() and start_tls() (GH-7130)Yury Selivanov2018-05-281-1/+31
| | | | | | | | | | | In this commit: * Support BufferedProtocol in set_protocol() and start_tls() * Fix proactor to cancel readers reliably * Update tests to be compatible with OpenSSL 1.1.1 * Clarify BufferedProtocol docs * Bump TLS tests timeouts to 60 seconds; eliminate possible race from start_serving * Rewrite test_start_tls_server_1
* bpo-33037: Skip sending/receiving after SSL transport closing (GH-6044)Andrew Svetlov2018-03-101-1/+5
| | | | * Skip write()/data_received() if sslpipe is destroyed
* bpo-32622: Implement loop.sendfile() (#5271)Andrew Svetlov2018-01-271-0/+7
|
* bpo-31399: Let OpenSSL verify hostname and IP address (#3462)Christian Heimes2018-01-271-6/+0
| | | | | | | | | | | | | | | bpo-31399: Let OpenSSL verify hostname and IP The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host() and X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses. * Remove match_hostname calls * Check for libssl with set1_host, libssl must provide X509_VERIFY_PARAM_set1_host() * Add documentation for OpenSSL 1.0.2 requirement * Don't support OpenSSL special mode with a leading dot, e.g. ".example.org" matches "www.example.org". It's not standard conform. * Add hostname_checks_common_name Signed-off-by: Christian Heimes <christian@python.org>
* bpo-29970: Make ssh_handshake_timeout None by default (#4939)Andrew Svetlov2017-12-201-1/+8
| | | | | * Make ssh_handshake_timeout None by default. * Raise ValueError if ssl_handshake_timeout is used without ssl. * Raise ValueError if ssl_handshake_timeout is not positive.
* bpo-29970: Add timeout for SSL handshake in asyncioNeil Aspinall2017-12-191-1/+13
| | | | 10 seconds by default.
* bpo-32356: idempotent pause_/resume_reading; new is_reading method. (#4914)Yury Selivanov2017-12-181-0/+6
|
* bpo-32262: Fix codestyle; use f-strings formatting where necessary. (#4775)Yury Selivanov2017-12-101-6/+7
|
* bpo-32069: Drop legacy SSL transport (#4451)Andrew Svetlov2017-11-181-16/+4
| | | | | | | | | | * Drop legacy SSL transport * Drop unused import * Fix Windows tests * Drop never executed on Python 3.4+ code
* bpo-31632: fix set_protocol() in _SSLProtocolTransport (#3817) (#3817)jlacoline2017-10-191-6/+4
|
* Revert "bpo-29406: asyncio SSL contexts leak sockets after calling close ↵Yury Selivanov2017-06-111-24/+1
| | | | | with certain servers (#409)" (#2111) This reverts commit a608d2d5a7f1aabe9bcbfc220135c5e126189390.
* bpo-29406: asyncio SSL contexts leak sockets after calling close with ↵Nikolay Kim2017-06-101-1/+24
| | | | | | | | certain servers (#409) * asyncio SSL contexts leak sockets after calling close with certain servers * cleanup _shutdown_timeout_handle on _fatal_error
* Break circular references when closing SSLTransport objects (#981)Michaël Sghaïer2017-06-091-4/+6
|
* Closing transport during handshake process leaks socket (#480)Nikolay Kim2017-06-091-2/+5
|
* bpo-29617: Remove Python 3.3 support from asyncio (GH-232)INADA Naoki2017-04-251-10/+5
|
* bpo-29742: asyncio get_extra_info() throws exception (#525)Nikolay Kim2017-03-121-1/+3
|
* Merge 3.5 (issue #28990)Yury Selivanov2016-12-161-0/+1
|\
| * Issue #28990: Fix SSL hanging if connection is closed before handshake ↵Yury Selivanov2016-12-161-0/+1
| | | | | | | | completed.
* | Merge 3.5 (issue #23749)Yury Selivanov2016-10-051-2/+5
|\ \ | |/
| * asyncio: Add "call_connection_made" arg to SSLProtocol.__init__Yury Selivanov2016-10-051-2/+5
| | | | | | | | | | | | | | | | | | Issue #23749: With this change it's possible to implement starttls as a separate package on PyPI, or even by copying/pasting a small snipped of code in your project. It's expected that we'll figure out the API design for starttls during 3.6, so that we can add it in 3.7.
* | Merge 3.5 (asyncio)Yury Selivanov2016-09-121-0/+6
|\ \ | |/
| * asyncio: Add set_protocol / get_protocol methods to TransportsYury Selivanov2016-09-121-0/+6
| |
* | Merge 3.5 (asyncio)Yury Selivanov2016-06-281-0/+1
|\ \ | |/
| * asyncio: Fix NameError in sslproto _fatal_error()Yury Selivanov2016-06-281-0/+1
| | | | | | | | Patch by Richard Walker.
* | Issue #27076: Merge spelling from 3.5Martin Panter2016-05-261-1/+1
|\ \ | |/
| * Issue #27076: Doc, comment and tests spelling fixesMartin Panter2016-05-261-1/+1
| | | | | | | | Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
* | Merge 3.5 (asyncio)Victor Stinner2016-04-011-1/+1
|\ \ | |/