f



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

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
0
forget-it (3)
5/19/2004 7:12:17 PM
comp.lang.python 77058 articles. 6 followers. Post Follow

3 Replies
981 Views

Similar Articles

[PageSpeed] 8

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


0
aweil (12)
5/19/2004 8:14:59 PM
On Wed, 19 May 2004, Phillip wrote:

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

--
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac@bullseye.apana.org.au  (pref) | Snail: PO Box 370
        andymac@pcug.org.au             (alt) |        Belconnen  ACT  2616
Web:    http://www.andymac.org/               |        Australia

0
andymac1 (136)
5/19/2004 11:15:39 PM
Andrew MacIntyre <andymac@bullseye.apana.org.au> writes:

> On Wed, 19 May 2004, Phillip wrote:
[...]
> > I just downloaded the sources onto Debian Linux and did the configure,
> > make, make install dance.
[...]

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
0
jjl (1300)
5/20/2004 6:58:33 PM
Reply: