[issue1926] NNTPS support in nntplib
New submission from Ray Chason: This patch adds SSL support to nntplib. It is a followup to issue #1535659 and addresses the objections raised in the comments to that issue; it also changes the default port to 563 (nntps) rather than 119 if SSL is requested. -- components: Library (Lib) files: python-nntps-patch-1.txt messages: 61648 nosy: chasonr severity: normal status: open title: NNTPS support in nntplib type: rfe versions: Python 2.5 Added file: http://bugs.python.org/file9280/python-nntps-patch-1.txt __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1926> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1926] NNTPS support in nntplib
Ray Chason added the comment: OK, I got a copy of the Subversion sources and the new SSL library looks like just what is needed here. Examining the other protocol modules that already support SSL, I find these things: httplib has: HTTPConnection(host[, port[, strict[, timeout]]]) HTTPSConnection(host[, port[, key_file[, cert_file[, strict[, timeout]) poplib has: POP3(host[, port[, timeout]]) POP3_SSL(host[, port[, keyfile[, certfile]]]) imaplib has: IMAP4([host[, port]]) IMAP4_SSL([host[, port[, keyfile[, certfile) smtplib has: SMTP([host[, port[, local_hostname[, timeout) SMTP_SSL([host[, port[, local_hostname[, keyfile[, certfile[, timeout]]) Now nntplib as it stands has no SSL-using variant. The existing factory method is: NNTP(host[, port[, user[, password[, readermode[, usenetrc]) What seems most consistent with the other modules is to define: NNTP_SSL(host[, port[, keyfile[, certfile[, user[, password[, readermode[, usenetrc]]]) __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1926> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1926] NNTPS support in nntplib
Ray Chason added the comment: Here's take 2. The pre-patch NNTP class has a long and complicated constructor. Rather than duplicate this constructor in NNTP_SSL, the patch converts most of the NNTP class to a new class, NNTPBase, which takes an already-connected socket as a parameter. NNTP and NNTP_SSL both inherit NNTPBase and create that socket in their own respective ways. Added file: http://bugs.python.org/file9286/python-nntps-patch-2.txt __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1926> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1926] NNTPS support in nntplib
Ray Chason added the comment: It seems that I, or whoever writes any future test_nntplib.py, would have to understand how existing tests such as test_smtplib.py work. It looks like that one is setting up some kind of miniature mail server and accepting a connection on localhost -- neat trick, binding a server socket to port 0 so it still works if you have a real mail server running. Anyway, getting good coverage isn't something I can bang out in an afternoon. Class NNTPBase and its derivatives (I'm talking post-patch of course) have lots of methods and I want to cover them as well as possible. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1926> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com