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

P

Phillip

Some people tipped me off on some possibilities to tackle my https
problem. Those have definitely gotten me further in cornering the
problem. Thank you.

But:
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.

Is there anybody I could ask who could know? Appart from bugging Guido
van Rossum over this that is. :)


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.


3) Where do I change the compile options (???), switches (???) - I don't
know how excactly this stuff is called - to set such stuff as what
things are compiled into the installation and which aren't. This is a
more general Linux/make/configure/gcc/whatnot sort of question, I know,
but I would be gratefull for any help.

Thank you.

Phillip
 
A

alejandro david weil

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

Andrew MacIntyre

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?

The ssl support, on both 2.2.x and 2.3.x, is built via the setup.py script
which gets run after the interpreter itself is built. If setup.py can
find the SSL headers, it will attempt to build with 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.

Is there anybody I could ask who could know? Appart from bugging Guido
van Rossum over this that is. :)

You didn't inspect the logs from the make process? the output from
setup.py towards the end will give clues as to whether SSL support was
included.
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.

For 2.3.x, there will be a _ssl.so to go with the _socket.so.

There is no visible indication with 2.3.x.
3) Where do I change the compile options (???), switches (???) - I don't
know how excactly this stuff is called - to set such stuff as what
things are compiled into the installation and which aren't. This is a
more general Linux/make/configure/gcc/whatnot sort of question, I know,
but I would be gratefull for any help.

Build options for SSL support are in setup.py.

Linux distros tend to "localise" anything and everything, so its not
possible that setup.py is not finding the SSL headers because they're
not where non-Debian people expect them to be. Added to the fact that
Linux distros also seem to go overboard in separating "developer" bits
(like header files) from "application bits". If you need the headers, you
need to install the apropriate developer packages.

I would have expected the Debian package of Python to have SSL support
though, unless its an optional package...
 
J

John J. Lee

[...]

Me too (on Debian woody).

Install libssl0.9.6 (or a newer version, maybe) AND libssl-dev, and
recompile. Or install a debian binary package of Python 2.3.


John
 

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
474,199
Messages
2,571,045
Members
47,643
Latest member
ashutoshjha_1101

Latest Threads

Top