nntplib and ssl

Antoine Pitrou solipsis at pitrou.net
Fri Oct 22 17:23:31 EDT 2010


On Fri, 22 Oct 2010 17:02:07 -0400
Andrew <none at none.com> wrote:
> 
> Python's nntplib seems ideal for my purposes, but as far as I can see it
> doesn't support nntps connections. If I understand nntp correctly (I may
> not) that means, among other things, it sends passwords in cleartext. 
> 
> That won't do. I note that python has a separate ssl module but I must
> admit I'm at a loss as to how to fit the two together. I'm working from the
> Python 3.1.2 documentation, page noted here:

There's an issue open for this:
http://bugs.python.org/issue1926

A patch is there, but it's totally outdated. If you're interested, you
could provide a new patch against py3k SVN (that is, the next 3.2,
although the deadline for new features is in a couple of weeks).

It's probably not very difficult to write such a patch. You mostly need
to wrap the connection in an SSL socket, then give that socket to the
NNTP connection class. Details will be found out by studying the
nntplib code.

Regards

Antoine.





More information about the Python-list mailing list