summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_nntplib.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-108303: Move all certificates to `Lib/test/certdata/` (GH-109489) ↵Miss Islington (bot)2023-10-101-1/+1
| | | | | | | | | | | | | (#109682) * gh-108303: Move all certificates to `Lib/test/certdata/` (GH-109489) (cherry picked from commit e57ecf6bbc59f999d27b125ea51b042c24a07bd9) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Python 3.12 backport: update also `test_nntplib`. Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: T. Wouters <thomas@python.org>
* bpo-45046: Support context managers in unittest (GH-28045)Serhiy Storchaka2022-05-081-2/+1
| | | | | | Add methods enterContext() and enterClassContext() in TestCase. Add method enterAsyncContext() in IsolatedAsyncioTestCase. Add function enterModuleContext().
* gh-91217: deprecate nntplib (GH-91543)Brett Cannon2022-04-151-2/+2
|
* bpo-43998: Fix testing without ssl module (GH-25790)Christian Heimes2021-05-011-3/+4
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-43998: Default to TLS 1.2 and increase cipher suite security (GH-25778)Christian Heimes2021-05-011-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ssl module now has more secure default settings. Ciphers without forward secrecy or SHA-1 MAC are disabled by default. Security level 2 prohibits weak RSA, DH, and ECC keys with less than 112 bits of security. :class:`~ssl.SSLContext` defaults to minimum protocol version TLS 1.2. Settings are based on Hynek Schlawack's research. ``` $ openssl version OpenSSL 1.1.1k FIPS 25 Mar 2021 $ openssl ciphers -v '@SECLEVEL=2:ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM' TLS_AES_256_GCM_SHA384 TLSv1.3 Kx=any Au=any Enc=AESGCM(256) Mac=AEAD TLS_CHACHA20_POLY1305_SHA256 TLSv1.3 Kx=any Au=any Enc=CHACHA20/POLY1305(256) Mac=AEAD TLS_AES_128_GCM_SHA256 TLSv1.3 Kx=any Au=any Enc=AESGCM(128) Mac=AEAD TLS_AES_128_CCM_SHA256 TLSv1.3 Kx=any Au=any Enc=AESCCM(128) Mac=AEAD ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(256) Mac=AEAD ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD ECDHE-ECDSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(128) Mac=AEAD ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(128) Mac=AEAD ECDHE-ECDSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH Au=ECDSA Enc=CHACHA20/POLY1305(256) Mac=AEAD ECDHE-RSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH Au=RSA Enc=CHACHA20/POLY1305(256) Mac=AEAD ECDHE-ECDSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AES(256) Mac=SHA384 ECDHE-RSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AES(256) Mac=SHA384 ECDHE-ECDSA-AES128-SHA256 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AES(128) Mac=SHA256 ECDHE-RSA-AES128-SHA256 TLSv1.2 Kx=ECDH Au=RSA Enc=AES(128) Mac=SHA256 DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH Au=RSA Enc=AESGCM(256) Mac=AEAD DHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AESGCM(128) Mac=AEAD DHE-RSA-AES256-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AES(256) Mac=SHA256 DHE-RSA-AES128-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AES(128) Mac=SHA256 ``` Signed-off-by: Christian Heimes <christian@python.org>
* 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-42794: Update test_nntplib to use offical group name for testing (GH-24037)Dong-hee Na2021-01-011-3/+7
|
* bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21822)Victor Stinner2020-08-111-3/+3
| | | Automerge-Triggered-By: @tiran
* bpo-39305: Update nntplib to merge nntplib.NNTP and nntplib._NNTPBase (GH-19817)Dong-hee Na2020-05-161-2/+14
|
* bpo-40275: Move transient_internet from test.support to socket_helper (GH-19711)Serhiy Storchaka2020-04-291-2/+2
|
* bpo-40275: Avoid importing socket in test.support (GH-19603)Serhiy Storchaka2020-04-251-2/+3
| | | | | | * Move socket related functions from test.support to socket_helper. * Import socket, nntplib and urllib.error lazily in transient_internet(). * Remove importing multiprocess.
* bpo-39259: nntplib.NNTP/NNTP_SSL now reject timeout = 0 (GH-17936)Dong-hee Na2020-01-111-0/+4
| | | | | nntplib.NNTP and nntplib.NNTP_SSL now raise a ValueError if the given timeout for their constructor is zero to prevent the creation of a non-blocking socket.
* bpo-39242: Updated the Gmane domain into news.gmane.io (GH-17903)Dong-hee Na2020-01-081-2/+2
|
* bpo-38614: Use test.support.INTERNET_TIMEOUT constant (GH-17565)Victor Stinner2019-12-101-4/+10
| | | | | Replace hardcoded timeout constants in tests with INTERNET_TIMEOUT of test.support, so it's easier to ajdust this timeout for all tests at once.
* bpo-35925: Skip SSL tests that fail due to weak external certs. (GH-13124)Gregory P. Smith2019-05-061-8/+29
| | | | | | | | Modern Linux distros such as Debian Buster have default OpenSSL system configurations that reject connections to servers with weak certificates by default. This causes our test suite run with external networking resources enabled to skip these tests when they encounter such a failure. Fixing the network servers is a separate issue.
* bpo-32128: Skip test_nntplib.test_article_head_body() (#4552)Victor Stinner2017-11-251-0/+1
| | | | | The NNTP server currently has troubles with SSL, whereas we don't have the control on this server. This test blocks all CIs, so disable it until a fix can be found.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-5/+4
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-30188: fix TypeError in test_nntplib (GH-2892)INADA Naoki2017-07-261-2/+2
| | | fixes regression of 5b4feb7
* bpo-30188: test_nntplib catch also ssl.SSLEOFError (#2843)Victor Stinner2017-07-241-1/+6
| | | | Catch also ssl.SSLEOFError in NetworkedNNTPTests setUpClass(). EOFError was already catched.
* bpo-30175: Skip client cert tests of test_imaplib (#1320)Victor Stinner2017-04-271-1/+6
| | | | | | | | | | | | | * bpo-30175: Skip client cert tests of test_imaplib The IMAP server cyrus.andrew.cmu.edu doesn't accept our randomly generated client x509 certificate anymore. * bpo-30188: Catch EOFError in NetworkedNNTPTests test_nntplib fails randomly with EOFError in NetworkedNNTPTests.setUpClass(). Catch EOFError to skip tests in that case.
* Issue #28971: Merge 3.5Xavier de Gaye2016-12-161-0/+2
|\
| * Issue #28971: Temporarily skip test_over until a permanent solution is foundXavier de Gaye2016-12-161-0/+2
| | | | | | | | for issue #28971.
* | Issue #28022: Deprecate ssl-related arguments in favor of SSLContext.Christian Heimes2016-09-101-2/+4
|/ | | | | | | 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 #27626: Spelling fixes in docs, comments and internal namesMartin Panter2016-07-281-2/+2
| | | | Based on patch by Ville Skyttä.
* Correct “an” → “a” with “Unicode”, “user”, “UTF”, etcMartin Panter2016-04-151-1/+1
| | | | This affects documentation, code comments, and a debugging messages.
* Issue #25859: Reimplement NNTP test_starttls() using local serverMartin Panter2016-01-191-18/+64
| | | | | | | The previous test relied on a remote server, which currently seems to be shutting the connection down once TLS has been set up, causing an EOFError. Now the test is implemented using a minimal NNTP server running in a background thread.
* Issue #22351. MockSslTests tests in test_nntplib now are reported if skipped.Serhiy Storchaka2015-04-031-9/+10
|
* Issue #22351: Fix test_nntplib if the ssl module is missingVictor Stinner2015-04-031-9/+10
| | | | | @unittest.skipUnless(ssl, '...') doesn't work because the class body uses the nntplib.NNTP_SSL attribute which doesn't exist.
* Issue #22351: The nntplib.NNTP constructor no longer leaves the connectionSerhiy Storchaka2015-03-211-4/+98
| | | | | and socket open until the garbage collector cleans them up. Patch by Martin Panter.
* Issue #22247: Add NNTPError to nntplib.__all__.Berker Peksag2014-09-201-5/+12
|
* Issue #18702: All skipped tests now reported as skipped.Serhiy Storchaka2013-11-031-36/+38
|
* merge with 3.3Georg Brandl2013-10-271-0/+10
|\
| * Issue #16040: CVE-2013-1752: nntplib: Limit maximum line lengths to 2048 toGeorg Brandl2013-10-271-0/+10
| | | | | | | | | | prevent readline() calls from consuming too much memory. Patch by Jyrki Pulliainen.
* | Issue #16717: get rid of socket.error, replace with OSErrorAndrew Svetlov2012-12-181-1/+1
|/
* Fix test to really run behind a NNTP virus checkerAntoine Pitrou2012-06-241-2/+5
|
* Merge from 3.2 (Ignore X-Antivirus headers in test_nntplib)Nick Coghlan2012-06-171-1/+4
|\
| * Ignore X-Antivirus headers in test_nntplibNick Coghlan2012-06-171-1/+4
| |
* | Issue #7644: Add tests for the file argument of NNTP.head() and NNTP.body().Antoine Pitrou2012-02-151-0/+40
|\ \ | |/ | | | | Patch by Hynek Schlawack.
| * Issue #7644: Add tests for the file argument of NNTP.head() and NNTP.body().Antoine Pitrou2012-02-151-0/+40
| | | | | | | | Patch by Hynek Schlawack.
* | Issue #10287: nntplib now queries the server's CAPABILITIES first before ↵Antoine Pitrou2012-02-141-1/+50
|\ \ | |/ | | | | | | | | sending MODE READER, and only sends it if not already in READER mode. Patch by Hynek Schlawack.
| * Issue #10287: nntplib now queries the server's CAPABILITIES first before ↵Antoine Pitrou2012-02-141-1/+50
| | | | | | | | | | | | sending MODE READER, and only sends it if not already in READER mode. Patch by Hynek Schlawack.
* | Issue #10287: nntplib now queries the server's CAPABILITIES again after ↵Antoine Pitrou2012-02-121-5/+57
|\ \ | |/ | | | | | | | | authenticating (since the result may change, according to RFC 4643). Patch by Hynek Schlawack.
| * Issue #10287: nntplib now queries the server's CAPABILITIES again after ↵Antoine Pitrou2012-02-121-5/+57
| | | | | | | | | | | | authenticating (since the result may change, according to RFC 4643). Patch by Hynek Schlawack.
* | Merge 3.2Florent Xicluna2011-10-281-2/+1
|\ \ | |/
| * Closes #13258: Use callable() built-in in the standard library.Florent Xicluna2011-10-281-2/+1
| |
* | #13012: use splitlines(keepends=True/False) instead of splitlines(0/1).Ezio Melotti2011-09-281-2/+2
| |
* | Issue 9795: adds context manager protocol to nntplib.NNTP class so that it ↵Giampaolo Rodolà2011-03-031-0/+21
| | | | | | | | can used with the 'with' statement.
* | Normalize the encoding names for Latin-1 and UTF-8 toMarc-André Lemburg2011-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | 'latin-1' and 'utf-8'. These are optimized in the Python Unicode implementation to result in more direct processing, bypassing the codec registry. Also see issue11303.
* | Fix imports from collections.abcRaymond Hettinger2011-02-231-2/+2
|/
* Make test_nntplib more robustAntoine Pitrou2010-11-211-2/+4
|