Python and SSL enabled

Heikki Toivonen heikki at osafoundation.org
Wed Nov 1 22:28:27 EST 2006


matey wrote:
> I tried to run the following simple program....
> 
> #!/usr/local/bin/python
> 
> import M2Crypto
> 
> u = M2Crypto.m2urllib.URLopener()
> u.open('http://www.yahoo.com')
> 
> However I got the following errror:
> 
> Traceback (most recent call last):
>   File "test.py", line 3, in ?
>     import M2Crypto
>   File "/home/mmedina/python2.3/site-packages/M2Crypto/__init__.py",
> line 14, in ?
>     import __m2crypto
> ImportError: ld.so.1: python: fatal: relocation error: file
> /home/mmedina/python2.3/site-packages/M2Crypto/__m2crypto.so: symbol
> d2i_SSL_SESSION: referenced symbol not found
> cengsu01:/home/mmedina/scripts/python >

Sorry, no idea why you are getting this.

Btw, I think even the M2Crypto m2urllib is unsafe, you'd be better of
using some of the other convenience libs libs httpslib or something.

> However, I went back to INSTALL instructions for m2crytpo.  I saw I
> forgot to run alltests.py
> 
> I ran the alltests.py and received the following:
> 
> Traceback (most recent call last):
> ImportError: No module named __m2crypto

Currently you need to install M2Crypto before you can run the tests.
Next version of M2Crypto will have an option to run tests without
installing. I'd assume if copied the sources to your own site-packages
dir and set the PYTHONPATH environment variable this would have worked.
Notice that you'd need to copy the *built* M2Crypto dir, not the source
M2Crypto dir which does not include the .so file.

-- 
  Heikki Toivonen



More information about the Python-list mailing list