summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ftplib.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-44498: suppress DeprecationWarnings for asynchat, asyncore and smtpd in ↵Miss Islington (bot)2021-06-241-2/+7
| | | | | | | | tests (GH-26905) (GH-26907) (cherry picked from commit 22e7effad571f8e524d2f71ff55bbf2a25306753) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* bpo-43880: Show DeprecationWarnings for deprecated ssl module features ↵Christian Heimes2021-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-25455) * ssl.OP_NO_SSLv2 * ssl.OP_NO_SSLv3 * ssl.OP_NO_TLSv1 * ssl.OP_NO_TLSv1_1 * ssl.OP_NO_TLSv1_2 * ssl.OP_NO_TLSv1_3 * ssl.PROTOCOL_SSLv2 * ssl.PROTOCOL_SSLv3 * ssl.PROTOCOL_SSLv23 (alias for PROTOCOL_TLS) * ssl.PROTOCOL_TLS * ssl.PROTOCOL_TLSv1 * ssl.PROTOCOL_TLSv1_1 * ssl.PROTOCOL_TLSv1_2 * ssl.TLSVersion.SSLv3 * ssl.TLSVersion.TLSv1 * ssl.TLSVersion.TLSv1_1 * ssl.wrap_socket() * ssl.RAND_pseudo_bytes() * ssl.RAND_egd() (already removed since it's not supported by OpenSSL 1.1.1) * ssl.SSLContext() without a protocol argument * ssl.match_hostname() * hashlib.pbkdf2_hmac() (pure Python implementation, fast OpenSSL function will stay) Signed-off-by: Christian Heimes <christian@python.org>
* bpo-43285 Make ftplib not trust the PASV response. (GH-24838)Gregory P. Smith2021-03-151-1/+26
| | | | | | | | | | | | | | | bpo-43285: Make ftplib not trust the PASV response. The IPv4 address value returned from the server in response to the PASV command should not be trusted. This prevents a malicious FTP server from using the response to probe IPv4 address and port combinations on the client network. Instead of using the returned address, we use the IP address we're already connected to. This is the strategy other ftp clients adopted, and matches the only strategy available for the modern IPv6 EPSV command where the server response must return a port number and nothing else. For the rare user who _wants_ this ugly behavior, set a `trust_server_pasv_ipv4_address` attribute on your `ftplib.FTP` instance to True.
* bpo-42413: socket.timeout is now an alias of TimeoutError (GH-23413)Christian Heimes2020-11-201-1/+1
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-41521: Rename blacklist parameter to not_exported (GH-21824)Victor Stinner2020-08-171-4/+5
| | | | Rename "blacklist" parameter of test.support.check__all__() to "not_exported".
* bpo-40275: Use new test.support helper submodules in tests (GH-21448)Hai Shi2020-08-031-1/+2
|
* bpo-40275: Adding threading_helper submodule in test.support (GH-20263)Hai Shi2020-05-271-2/+3
|
* bpo-40275: Avoid importing socket in test.support (GH-19603)Serhiy Storchaka2020-04-251-5/+6
| | | | | | * Move socket related functions from test.support to socket_helper. * Import socket, nntplib and urllib.error lazily in transient_internet(). * Remove importing multiprocess.
* bpo-39380: Change ftplib encoding from latin-1 to utf-8 (GH-18048)Sebastian Pedersen2020-04-131-32/+62
| | | | | Add the encoding in ftplib.FTP and ftplib.FTP_TLS to the constructor as keyword-only and change the default from "latin-1" to "utf-8" to follow RFC 2640.
* bpo-39259: ftplib.FTP/FTP_TLS now reject timeout = 0 (GH-17959)Dong-hee Na2020-01-131-0/+4
|
* bpo-38614: Use test.support.LOOPBACK_TIMEOUT constant (GH-17554)Victor Stinner2019-12-101-1/+1
| | | | | Replace hardcoded timeout constants in tests with LOOPBACK_TIMEOUT of test.support, so it's easier to ajdust this timeout for all tests at once.
* Remove binding of captured exceptions when not used to reduce the chances of ↵Pablo Galindo2019-11-191-1/+1
| | | | | | | creating cycles (GH-17246) Capturing exceptions into names can lead to reference cycles though the __traceback__ attribute of the exceptions in some obscure cases that have been reported previously and fixed individually. As these variables are not used anyway, we can remove the binding to reduce the chances of creating reference cycles. See for example GH-13135
* bpo-35934: Add socket.create_server() utility function (GH-11784)Giampaolo Rodola2019-04-081-6/+3
|
* bpo-34391: Fix ftplib test for TLS 1.3 (GH-8787)Christian Heimes2018-08-161-0/+5
| | | | | | | | | | | | Read from data socket to avoid "[SSL] shutdown while in init" exception during shutdown of the dummy server. Signed-off-by: Christian Heimes <christian@python.org> <!-- issue-number: [bpo-34391](https://www.bugs.python.org/issue34391) --> https://bugs.python.org/issue34391 <!-- /issue-number -->
* bpo-33618: Enable TLS 1.3 in tests (GH-7079)Christian Heimes2018-05-231-7/+3
| | | | | | | | | | | | TLS 1.3 behaves slightly different than TLS 1.2. Session tickets and TLS client cert auth are now handled after the initialy handshake. Tests now either send/recv data to trigger session and client certs. Or tests ignore ConnectionResetError / BrokenPipeError on the server side to handle clients that force-close the socket fd. To test TLS 1.3, OpenSSL 1.1.1-pre7-dev (git master + OpenSSL PR https://github.com/openssl/openssl/pull/6340) is required. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes (#5663)Christian Heimes2018-02-271-0/+6
| | | | | | | | | | | | | | | | | | * bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes Misc fixes and workarounds for compatibility with OpenSSL 1.1.1-pre1 and TLS 1.3 support. With OpenSSL 1.1.1, Python negotiates TLS 1.3 by default. Some test cases only apply to TLS 1.2. Other tests currently fail because the threaded or async test servers stop after failure. I'm going to address these issues when OpenSSL 1.1.1 reaches beta. OpenSSL 1.1.1 has added a new option OP_ENABLE_MIDDLEBOX_COMPAT for TLS 1.3. The feature is enabled by default for maximum compatibility with broken middle boxes. Users should be able to disable the hack and CPython's test suite needs it to verify default options. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-32706: Skip test_ftplib.test_check_hostname() (#5422)Victor Stinner2018-01-291-0/+1
| | | | | | This test is unstable and currently prevents to make any new change since the test always fails on Travis CI. Skip the test to get more time to fix it.
* bpo-31399: Let OpenSSL verify hostname and IP address (#3462)Christian Heimes2018-01-271-0/+3
| | | | | | | | | | | | | | | 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-31346: Use PROTOCOL_TLS_CLIENT/SERVER (#3058)Christian Heimes2017-09-151-12/+6
| | | | | | Replaces PROTOCOL_TLSv* and PROTOCOL_SSLv23 with PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-31234: Fix dangling thread in test_ftplib (#3544)Victor Stinner2017-09-131-0/+2
| | | Clear also self.server_thread attribute in TestTimeouts.tearDown().
* bpo-31234: Fix dangling thread in test_ftp/poplib (#3540)Victor Stinner2017-09-131-0/+6
| | | | Explicitly clear the server attribute in test_ftplib and test_poplib to prevent dangling thread.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-1/+1
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-30119: fix ftplib.FTP.putline() to throw an error for a illegal command ↵Dong-hee Na2017-07-221-1/+5
| | | | (#1214)
* bpo-30818: test_ftplib calls asyncore.close_all() (#2514)Victor Stinner2017-06-301-0/+3
| | | | | | | | | | Always clear asyncore socket map using asyncore.close_all(ignore_all=True) in tearDown() method. This change should fix this warning: Warning -- asyncore.socket_map was modified by test_ftplib Before: {} After: {4: <test.test_ftplib.DummyTLS_FTPServer 127.0.0.1:0 at 0x805feccf0>}
* Issue #28022: Deprecate ssl-related arguments in favor of SSLContext.Christian Heimes2016-09-101-4/+6
| | | | | | | The deprecation include manual creation of SSLSocket and certfile/keyfile (or similar) in ftplib, httplib, imaplib, smtplib, poplib and urllib. ssl.wrap_socket() is not marked as deprecated yet.
* Issue #23883: Add missing APIs to __all__; patch by Jacek KołodziejMartin Panter2015-11-141-1/+10
|
* merge 3.4 (#22935)Benjamin Peterson2014-12-061-1/+1
|\
| * allow ssl module to compile if openssl doesn't support SSL 3 (closes #22935)Benjamin Peterson2014-12-061-1/+1
| | | | | | | | Patch by Kurt Roeckx.
* | merge 3.4 (#22921)Benjamin Peterson2014-11-231-4/+0
|\ \ | |/
| * don't require OpenSSL SNI to pass hostname to ssl functions (#22921)Benjamin Peterson2014-11-231-4/+0
| | | | | | | | Patch by Donald Stufft.
* | Issue #6623: Remove deprecated Netrc class in the ftplib module.Berker Peksag2014-11-011-17/+6
| | | | | | | | Patch by Matt Chaput.
* | Issue #21566: Make use of socket.listen() default backlog.Charles-François Natali2014-07-231-3/+3
|/
* Issue #20555: Use specific asserts in urllib, httplib, ftplib, cgi, wsgiref ↵Serhiy Storchaka2014-02-081-3/+3
|\ | | | | | | tests.
| * Issue #20555: Use specific asserts in urllib, httplib, ftplib, cgi, wsgiref ↵Serhiy Storchaka2014-02-081-3/+3
| | | | | | | | tests.
| * Issue #18702: All skipped tests now reported as skipped.Serhiy Storchaka2013-11-031-7/+7
| |
* | fixed test_ftplibChristian Heimes2013-12-151-1/+1
| |
* | test_ftplib: skip check_hostname test when SNI is not availableChristian Heimes2013-12-151-0/+4
| |
* | Issue #19781: ftplib now supports SSLContext.check_hostname and server nameChristian Heimes2013-12-021-1/+32
| | | | | | | | indication for TLS/SSL connections.
* | Issue #18702: All skipped tests now reported as skipped.Serhiy Storchaka2013-11-031-7/+7
| |
* | Issue #16038: CVE-2013-1752: ftplib: Limit amount of data read bySerhiy Storchaka2013-10-201-1/+21
|\ \ | |/ | | | | | | limiting the call to readline(). Original patch by Michał Jastrzębski and Giampaolo Rodola.
| * Issue #16038: CVE-2013-1752: ftplib: Limit amount of data read bySerhiy Storchaka2013-10-201-1/+21
| | | | | | | | | | limiting the call to readline(). Original patch by Michał Jastrzębski and Giampaolo Rodola.
* | merge 3.3 (#19118)Benjamin Peterson2013-09-291-4/+0
|\ \ | |/
| * remove duplicate test_mkd (closes #19118)Benjamin Peterson2013-09-291-4/+0
| |
| * Issue #18792: Use "127.0.0.1" or "::1" instead of "localhost" as much as ↵Antoine Pitrou2013-08-211-4/+4
| | | | | | | | possible, since "localhost" goes through a DNS lookup under recent Windows versions.
* | Issue #18792: Use "127.0.0.1" or "::1" instead of "localhost" as much as ↵Antoine Pitrou2013-08-211-4/+4
| | | | | | | | possible, since "localhost" goes through a DNS lookup under recent Windows versions.
* | merge from 3.3Senthil Kumaran2013-08-131-0/+8
|\ \ | |/ | | | | Increasing test coverage of ftplib. Patch by Muhammad Jehanzeb
| * Increasing test coverage of ftplib. Patch by Muhammad JehanzebSenthil Kumaran2013-08-131-0/+8
| |
* | test_ftplib: silence a BytesWarning when checking TypeErrorFlorent Xicluna2013-07-061-1/+2
|\ \ | |/
| * test_ftplib: silence a BytesWarning when checking TypeErrorFlorent Xicluna2013-07-061-1/+2
| |
* | ftplib tests: provide a global socket's TIMEOUT variable and use it ↵Giampaolo Rodola'2013-05-161-14/+15
| | | | | | | | everywhere so that failing tests won't accidentally hang