Re: SSL (HTTPS) with 2.4

2005-05-26 Thread Bloke
OK. I try pyopenssl and can get a secure socket to the server, but am unsure how to use this socket with urllib2 or even httplib. Here's the code I'm using: import sys, socket, string, base64, httplib from OpenSSL import SSL # Connects to the server, through the proxy def run(server, proxy):

Re: SSL (HTTPS) with 2.4

2005-05-25 Thread pyguy2
After failed attempts at trying to get my code to work with squid. I did some research into this and came up with some info. http://www.python.org/peps/pep-0320.txt - It would be nice if the built-in SSL socket type could be used for non-blocking SSL I/O. Currently packages such as Twisted

Re: SSL (HTTPS) with 2.4

2005-05-20 Thread Andrew Bushnell
That would be nice if something could be added to the distribution. In general, what needs to be done is as follows: #1: Connect to proxy host:port #2: Send CONNECT request with host:443 of secure url you want to tunnel to. Additional headers can be added depending on authorization needed for

Re: SSL (HTTPS) with 2.4

2005-05-19 Thread Andrew Bushnell
I am interested in any further progress with this, you may have made? I am facing a similar issue. In short, I need to connect to a https site (in this case a WSDL) that I need to access through an Http proxy. I have tried various things to no avail. I did find a couple recipes on the ASPN

Re: SSL (HTTPS) with 2.4

2005-05-19 Thread Bloke
Andrew, It seems I'm not the only one going nuts here. I have just spent the last 4 hrs stepping through the code in the debugger. It seems to get stuck somewhere in the socket module (when it calls ssl) but haven't as yet figured out exactly where. I am _very_ interested to find that you have

Re: SSL (HTTPS) with 2.4

2005-05-19 Thread Andrew Bushnell
Thanks for the update. I will/can keep you posted. I know for a fact we use a Squid proxy which sounds like what you are using. I am going to check out the faq you sent and see what it comes up with. I have also been perusing the net a bit and looking at other client packages and see if they

Re: SSL (HTTPS) with 2.4

2005-05-19 Thread andreas
Hi! HTTPS over a proxy (CONNECT) hasn't worked for a long time in python (actually it has never worked). A quick glance at the 2.4 Changelog doesn't suggest that this has been fixed. So basically you've got the following options: a) redo your own http/https support. b) look around on the net

Re: SSL (HTTPS) with 2.4

2005-05-19 Thread Andrew Bushnell
Thanks for the feedback. andreas. I am looking into how to work my own connection logic into the code. Google has quickly become my friend and I am actually poking at cURL (pyCurl) to see what benefit it will be. Thanks again. [EMAIL PROTECTED] wrote: Hi! HTTPS over a proxy (CONNECT)

Re: SSL (HTTPS) with 2.4

2005-05-19 Thread pyguy2
If you need some help, send me an email and if we figure this out we can post a resolution. I have used both approaches (having authored them). Or at least let me know what site you are going to and I will try them on a windows box and see if I can debug that the [EMAIL PROTECTED]@ is going on.

Re: SSL (HTTPS) with 2.4

2005-05-19 Thread Bloke
Ideally, we should aim at a 'fix' that can be included in the distribution. I am going to look at what communication goes on between the proxy server and a working browser by monitoring the traffic. From what i understand, the proxy needs to be told first to set up a secure connection with the

Re: SSL (HTTPS) with 2.4

2005-05-18 Thread Bloke
Thanks Martin. That means my code should work. I am trying to go through a proxy, which works fine for HTTP sites. However, when I try a HTTPS site, the program doesn't respond for quite a while, and returns the error: File C:\Python24\lib\urllib2.py, line 996, in do_open raise

Re: SSL (HTTPS) with 2.4

2005-05-18 Thread Bloke
I just removed my installation of Python 2.4.1, which was the one on the python.org web site. I installed the Activepython 2.4.1 and now I get the following error with the same code above: File C:\Python24\lib\urllib2.py, line 1053, in unknown_open raise URLError('unknown url type: %s' %

Re: SSL (HTTPS) with 2.4

2005-05-18 Thread Lucas Raab
Bloke wrote: I just removed my installation of Python 2.4.1, which was the one on the python.org web site. I installed the Activepython 2.4.1 and now I get the following error with the same code above: File C:\Python24\lib\urllib2.py, line 1053, in unknown_open raise URLError('unknown

Re: SSL (HTTPS) with 2.4

2005-05-18 Thread Bloke
Yes, on looking into it, sockets.ssl is not installed with activepython, so it doesn't recognise https. So I have removed it, and reinstalled the v 2.4.1 which I downloaded from www.python.org . This leaves me with with the problem where the script 'hangs' for a long time, then returns:

Re: SSL (HTTPS) with 2.4

2005-05-18 Thread Bloke
Following my above comment, if my script works with http, then what is the problem with https, even when I change the ProxyHandler to specify https? -- http://mail.python.org/mailman/listinfo/python-list

Re: SSL (HTTPS) with 2.4

2005-05-18 Thread Martin v. Löwis
Bloke wrote: Following my above comment, if my script works with http, then what is the problem with https, even when I change the ProxyHandler to specify https? I believe there is a bug in the https implementations of certain Web services, in particular the Microsoft-ish ones. They are

Re: SSL (HTTPS) with 2.4

2005-05-18 Thread Trent Mick
[Bloke wrote] I just removed my installation of Python 2.4.1, which was the one on the python.org web site. I installed the Activepython 2.4.1 and now I get the following error with the same code above: File C:\Python24\lib\urllib2.py, line 1053, in unknown_open raise

Re: SSL (HTTPS) with 2.4

2005-05-18 Thread Paul Rubin
Trent Mick [EMAIL PROTECTED] writes: Unfortunately ActivePython cannot include the SSL library by default because of crypto export regulations. That hasn't been true for several years. In principle you're supposed to notify the commerce department but in fact they seem to just ignore the

Re: SSL (HTTPS) with 2.4

2005-05-18 Thread Bloke
Thanks Martin. The problem seems to lie with our company proxy (which requires authentication). I have tried retrieving the page on another network with a transparent proxy, and it all works fine. Unfortnately, any https page I try to retrieve on the company network fails in this way with after

SSL (HTTPS) with 2.4

2005-05-17 Thread Bloke
Hi all. Some time ago (years) I had a script on Python 2.2 that would retieve a HTTPS web site. I used python22-win32-ssl.zip to handle the SSL aspect and it worked wonderfully. I am revisiting the project and need to update it to Python 2.4.1. python22-win32-ssl.zip isn't compatable (duh) and

Re: SSL (HTTPS) with 2.4

2005-05-17 Thread Martin v. Löwis
Bloke wrote: Some time ago (years) I had a script on Python 2.2 that would retieve a HTTPS web site. I used python22-win32-ssl.zip to handle the SSL aspect and it worked wonderfully. I am revisiting the project and need to update it to Python 2.4.1. python22-win32-ssl.zip isn't compatable