summaryrefslogtreecommitdiff
path: root/amqp
Commit message (Collapse)AuthorAgeFilesLines
* Set an explicit timeout on SSL handshake to prevent hangsCarlos Corbacho2022-11-121-0/+2
| | | | | | | | If we do not set a timeout on the SSL handshake, this can cause an infinite hang if something happens during this point to the remote end - this has been seen with AWS MQ RabbitMQ during cluster maintenance triggering a reboot, and causing hangs of any connection that is in the handshake phase.
* Bump version: 5.1.0 → 5.1.1v5.1.1Asif Saif Uddin2022-04-171-1/+1
|
* Use AF_UNSPEC for name resolution (#389)John Eckersberg2022-04-081-51/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use AF_UNSPEC for name resolution This reverts most of 1ad97fb14c0c3c57395ca525932f95a830e51a88, but keeps tests which still have general applicability. The reason the original change was made was to try and work around a bug[1] in the eventlet library. Eventlet monkey-patches the socket.getaddrinfo function and replaces it with its own async, eventlet-aware implementation. The reason name resolution was broken in the first place is because eventlet was consulting DNS first, and then if that failed, falling back to /etc/hosts, which is just flat out incorrect behavior. It's important to note that this was *only* when running py-amqp under eventlet, and *only* for specific versions of eventlet that have long been fixed. So this workaround is not even needed anymore. With "normal" (non-eventlet) use, socket.getaddrinfo instead calls into the glibc getaddrinfo implementation, which ultimately uses libnss to resolve hostnames. However, there is an issue with the original workaround when using the default (glibc) getaddrinfo. The workaround (current) implementation explicitly forces resolution to use AF_INET (IPv4) and then only if that does not succeed, it in turn will try with AF_INET6 (IPv6). This generally works well for IPv4-only hosts, but can be unnecessarily slow for dual-stack IPv4/IPv6 hosts. Consider the following: - We want to connect to example.org - The /etc/hosts file contains an IPv6 entry: example.org f00d::1 - The /etc/nsswitch.conf file contains typical (simplified) hosts config: hosts: files dns In this case, the current code will involve nss iterating through the modules: - files (with AF_INET): fails, because there is no IPv4 address in /etc/hosts - dns (with AF_INET): may or may not succeed per-site, depending on how DNS is configured. If DNS is slow/misconfigured, this may incur a delay and block for a significant amount of time. - files (with AF_INET6): succeeds, and getaddrinfo returns f00d::1. Now in the same scenario as before, with this fix which reverts back to using AF_UNSPEC instead: - files (with AF_UNSPEC) succeeds, and getaddrinfo returns f00d::1. There is no need to involve DNS at all. Even a well-configured, quick-to-respond DNS server is going to be many orders of magnitude slower than consulting with /etc/hosts which libnss keeps cached in memory. [1] https://bugs.launchpad.net/neutron/+bug/1696094/comments/22 * tests: ensure getaddrinfo is called with AF_UNSPEC
* Bump version: 5.0.9 → 5.1.0v5.1.0Asif Saif Uddin2022-03-061-1/+1
|
* adding experimental __slots__ to some classes (#368)Asif Saif Uddin2022-02-086-0/+81
| | | | | | | | | | | * adding experimental __slots__ to some classes * adding more experimental __slots__ to some classes * remove redundant slots * added more experimental slots to classes * remove slots from buffer class
* document memoryview usage, minor frame_writer.write_frame refactor (#384)Paul Brown2021-12-241-8/+11
| | | | | | | * document memory_view usage, refactor frame_writer.write_frame * improve test for changing frame_max in write_frame * add integration test for write_frame/send_heartbeat
* improve performance of _get_free_channel_id, fix channel max bug (#385)Paul Brown2021-12-221-2/+5
| | | | | * improve performance of _get_free_channel_id, fix channel max bug * add integration tests for _get_free_channel_id performance improvement
* Bump version: 5.0.8 → 5.0.9v5.0.9Asif Saif Uddin2021-12-201-1/+1
|
* append to _used_channel_ids in _used_channel_idsPaul Brown2021-12-201-0/+1
|
* Bump version: 5.0.7 → 5.0.8v5.0.8Asif Saif Uddin2021-12-191-1/+1
|
* Add additional error handling around code where an OSError may be raised on ↵Michael Lazar2021-12-161-2/+10
| | | | failed connections. Fixes #378
* reduce memory usage of Connection (#377)Paul Brown2021-12-142-11/+17
| | | | | * reduce memory usage of Connection * allow ValueError on _used_channel_ids.remove
* Bump version: 5.0.6 → 5.0.7v5.0.7Asif Saif Uddin2021-12-131-1/+1
|
* Adding two tests, for Connection.collect and Transport.close.VinayGValsaraj2021-12-122-22/+21
|
* Fix typosKian-Meng, Ang2021-11-064-5/+5
|
* Bump version: 5.0.5 → 5.0.6v5.0.6Asif Saif Uddin (Auvi)2021-04-011-1/+1
|
* Fix typos.Omer Katz2021-02-281-5/+5
|
* Fix ordering of context.check_hostname and context.verify_mode so as to not ↵Colton Hicks2021-02-221-3/+12
| | | | raise ValueError if cert_reqs=ssl.CERT_NONE.
* remove TCP_USER_TIMEOUT option for SolarisCiaran McGirl2021-02-061-0/+2
|
* Bump version: 5.0.4 → 5.0.5v5.0.5Asif Saif Uddin (Auvi)2021-01-281-1/+1
|
* remove wrong imports occured by commits from another branchAsif Saif Uddin (Auvi)2021-01-281-566/+0
|
* remove wrong imports occured by commits from another branchAsif Saif Uddin (Auvi)2021-01-281-1/+0
|
* Bump version: 5.0.3 → 5.0.4v5.0.4Asif Saif Uddin (Auvi)2021-01-281-1/+1
|
* Merge branch 'master' of https://github.com/celery/py-amqpAsif Saif Uddin (Auvi)2021-01-282-10/+29
|\
| * Add missing load_default_certs() call. (#350)Moisés Guimarães de Medeiros2021-01-271-0/+8
| | | | | | Fixes: #349
| * Bump version: 5.0.2 → 5.0.3v5.0.3Asif Saif Uddin (Auvi)2021-01-201-1/+1
| |
| * Fix _wrap_socket_sni (#347)Moisés Guimarães de Medeiros2020-12-221-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change the default value of ssl_version to None. When not set, the proper value between ssl.PROTOCOL_TLS_CLIENT and ssl.PROTOCOL_TLS_SERVER will be selected based on the param server_side in order to create a TLS Context object with better defaults that fit the desired connection side. * Change the default value of cert_reqs to None. The default value of ctx.verify_mode is ssl.CERT_NONE, but when ssl.PROTOCOL_TLS_CLIENT is used, ctx.verify_mode defaults to ssl.CERT_REQUIRED. * Fix context.check_hostname logic. Checking the hostname depends on having support of the SNI TLS extension and being provided with a server_hostname value. Another important thing to mention is that enabling hostname checking automatically sets verify_mode from ssl.CERT_NONE to ssl.CERT_REQUIRED in the stdlib ssl and it cannot be set back to ssl.CERT_NONE as long as hostname checking is enabled. * Refactor the SNI tests to test one thing at a time and removing some tests that were being repeated over and over. Signed-off-by: Moisés Guimarães de Medeiros <guimaraes@pm.me>
* | import types to initAsif Saif Uddin (Auvi)2021-01-191-0/+1
| |
* | initial abstract typestypesAsif Saif Uddin (Auvi)2020-12-131-4/+565
| |
* | initial base typesAsif Saif Uddin (Auvi)2020-12-131-0/+5
|/
* Reworks _wrap_soscket_sni doctextMoisés Guimarães de Medeiros2020-11-271-12/+16
| | | | | | | | | | * Normalizes all params descriptions starting with a capitalized letter. * Removes 'client' reference from key and cert, as the server_side param states, this can be used by either side of the conversation. * Enhances cert_reqs description covering all the possible values with a more acurate behaviour explanation. Signed-off-by: Moisés Guimarães de Medeiros <guimaraes@pm.me>
* Initial reference documentation amqp.transportMatus Valo2020-11-102-15/+177
|
* Bump version: 5.0.1 → 5.0.2v5.0.2Omer Katz2020-11-081-1/+1
|
* autopep8 + isortOmer Katz2020-11-085-3/+7
|
* Basic publish confirm timeout fix (#343)RezaSi2020-11-081-5/+29
| | | | | | | | | | | | | | | * Reuse the timeout for publishing to wait for a response. * Added the confirm_timeout keyword argument. If a timeout was specified and confirm_timeout was not use the timeout. Otherwise, use the confirm_timeout. * Fix unit test. * Add document for timeout and confirm_timeout in _basic_publish Co-authored-by: Omer Katz <omer.drow@gmail.com> Co-authored-by: Reza Shiri <rezashiri@cafebazaar.ir>
* Reintroduce ca_certs and ciphers parameters of ↵Matus Valo2020-11-081-2/+6
| | | | | SSLTransport._wrap_socket_sni() (#344) This fixes issue introduced in commit: 53d677754b4e820acf673711532c1a1dc8e57124
* Cosmetic improvements to read_frame()Matus Valo2020-10-131-3/+13
|
* Added __repr__ to Connection() and *Transport() classesMatus Valo2020-09-142-0/+16
|
* Bump version: 5.0.0 → 5.0.1v5.0.1Omer Katz2020-09-061-1/+1
|
* Bump version: 5.0.0b1 → 5.0.0v5.0.0Omer Katz2020-09-031-1/+1
|
* pyupgrade.Omer Katz2020-09-039-32/+31
|
* Bump version: 5.0.0a1 → 5.0.0b1Omer Katz2020-09-031-1/+1
|
* Stop to use deprecated method ssl.wrap_socket (#327)Hervé Beraud2020-09-022-18/+12
| | | | | | | | | | | | | | | | | | `ssl.wrap_socket` is deprecated since python 3.7 and since python 3.2 and 2.7.9 (released in 2014) it is recommended to use the SSLContext.wrap_socket() instead of wrap_socket(). The top-level function is limited and creates an insecure client socket without server name indication or hostname matching [1]. Python 2.7 is now officially unmaintained, latest version of python 2.7 is 2.7.18, py-amqp only support python versions who are compatible with these changes [2]. These changes move away from `ssl.wrap_socket` by using now `ssl.SSLContext.wrap_socket` [3]. [1] https://docs.python.org/3/library/ssl.html#ssl.wrap_socket [2] https://github.com/celery/py-amqp/blob/master/setup.py#L24,L29 [3] https://docs.python.org/3/library/ssl.html#ssl.SSLContext.wrap_socket
* Happify linters without errors.Omer Katz2020-08-311-3/+5
|
* Happify linters.Omer Katz2020-08-316-22/+15
|
* isort.Omer Katz2020-08-312-33/+13
|
* Default to ssl.PROTOCOL_TLS.Omer Katz2020-08-311-1/+1
|
* Python issue 10272 has been fixed in Python 3.1.Omer Katz2020-08-311-4/+0
| | | | See http://bugs.python.org/issue10272 for details.
* Remove get_errno() since it is no longer needed.Omer Katz2020-08-312-24/+5
|
* All supported Python versions detect the optimal Python version.Omer Katz2020-08-311-11/+0
| | | | Since we no longer support Python 2.7, this code can be removed.