nntplib and ssl

A

Andrew

I'm working on a personal project that, among other things, needs to talk
to a news server.

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:
http://docs.python.org/py3k/library/nntplib.html

Anyone have suggestions?
 
A

Antoine Pitrou

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.
 
A

Andrew

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

I found that but noted it was dated for a few years ago. Of course like an
idiot I didn't scroll down the page and see that it was still active as of
last month.
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).

I'd say I'm interested...but despite not being too terrible a programmer,
I've never written and submitted a patch for anything in my life and have
no idea how to go about it. ;-) I suppose google could solve that problem.
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.

I might take a crack at it if I can figure out how. Thanks for the help.
 
S

Steve Holden

I found that but noted it was dated for a few years ago. Of course like an
idiot I didn't scroll down the page and see that it was still active as of
last month.


I'd say I'm interested...but despite not being too terrible a programmer,
I've never written and submitted a patch for anything in my life and have
no idea how to go about it. ;-) I suppose google could solve that problem.


I might take a crack at it if I can figure out how. Thanks for the help.
You might find helpful information at

http://python.org/dev/

regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top