Serious trouble with https (Python 2.2.3 & 2.3.3), How to check for working ssl?

alejandro david weil aweil at mail.ru
Wed May 19 16:14:59 EDT 2004


On Wed May 19 2004 16:12, Phillip wrote:

> No matter what I do to open a webconnection with httpS I always get
> something in this Area:
> urllib2.URLError: <urlopen error unknown url type: https>
>
> With both versions of Python mentioned above.
>
> My strong suspicion is that the socket stuff (dunno exact libname right
> now...) is compiled without ssl support.
>
> What I would like to know now is following:
>
> 1) What is the default setting for the compilation of the original
> Python source? _With_or _without_ ssl support?
>
> I just downloaded the sources onto Debian Linux and did the configure,
> make, make install dance. No fumbling on my side done here.

> 2) If this can't be said for shure _how_ can I find out if my version of
> Python was compiled with ssl support? Apart from trying to connect via
> https that is. Like I said: I've got a seriously growing suspicion that
> it _is_ unsupported ssl due to compilation.

I'm using python 2.3 in debian (package: python version 2.3.1-3) and has
ssl support. You may try:

aweil at tenuki:~$ python
Python 2.3.1 (#2, Sep 30 2003, 00:50:40)
[GCC 3.3.2 20030908 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.ssl(-1)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/socket.py", line 73, in ssl
    return _realssl(sock, keyfile, certfile)
TypeError: ssl() argument 1 must be _socket.socket, not int

socket.ssl function is used to handshake ssl over a socket.. 


Sometimes I had problems using ssl with urllib, and proxies.
So I wrote: http://ahttplib.sf.net/   There aren't packages for
install ready, but you can download it from cvs (*) (its 4 files).
The main file, includes some usage example, in its unittest
section.

Good luck and tell me if I can help you.
david

(*) http://cvs.sourceforge.net/viewcvs.py/ahttplib/ahttplib/


-- 
+ There is no dark side of the moon really. Matter of fact it's all dark.





More information about the Python-list mailing list