Python and SSL enabled

matey monica.medina at ngc.com
Fri Nov 3 16:49:12 EST 2006


It appears my __m2crypto.so didn't get built correctly.
================================================
cengsu01:/home/mmedina/crypt/m2kcrypto/m2crypto-0.16 >python setup.py
build
/usr/local/lib/python2.3/distutils/extension.py:128: UserWarning:
Unknown Extension options: 'swig_opts'
  warnings.warn(msg)
running build
running build_py
running build_ext
building '__m2crypto' extension
swig -python -ISWIG -I/home/mmedina/crypt/openssl/openssl-0.9.8/include
-o SWIG/_m2crypto.c SWIG/_m2crypto.i
gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
-fPIC -I/home/mmedina/crypt/m2kcrypto/m2crypto-0.16/SWIG
-I/home/mmedina/crypt/openssl/openssl-0.9.8/include
-I/usr/local/include/python2.3 -c SWIG/_m2crypto.c -o
build/temp.solaris-2.9-sun4u-2.3/SWIG/_m2crypto.o -DTHREADING
In file included from /usr/local/include/python2.3/stringobject.h:10,
                 from /usr/local/include/python2.3/Python.h:83,
                 from SWIG/_m2crypto.c:13:
/opt/sfw/lib/gcc-lib/sparc-sun-solaris2.9/2.95.3/include/stdarg.h:170:
warning: redefinition of `va_list'
/usr/include/stdio.h:120: warning: `va_list' previously declared here
SWIG/_m2crypto.c:3502: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:3666: warning: function declaration isn't a prototype
SWIG/_m2crypto.c: In function `make_stack_from_der_sequence':
SWIG/_m2crypto.c:3763: warning: function declaration isn't a prototype
SWIG/_m2crypto.c: At top level:
SWIG/_m2crypto.c:4897: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:5589: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:6556: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:7689: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:8111: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:8912: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:10924: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:13654: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:15281: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:13654: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:15281: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:15302: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:15895: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:16086: warning: function declaration isn't a prototype
SWIG/_m2crypto.c:559: warning: `SWIG_Python_ConvertPacked' defined but
not used
warning: no library file corresponding to '/home/mmedina/lib' found
(skipping)
gcc -shared build/temp.solaris-2.9-sun4u-2.3/SWIG/_m2crypto.o
-L/home/mmedina/crypt/openssl/openssl-0.9.8/lib -lssl -lcrypto -o
build/lib.solaris-2.9-sun4u-2.3/M2Crypto/__m2crypto.so
Text relocation remains                         referenced
    against symbol                  offset      in file
<unknown>                           0x5c0
/home/mmedina/lib/libssl.a(s3_lib.o)
<unknown>                           0x5c4
/home/mmedina/lib/libssl.a(s3_lib.o)
<unknown>                           0x5c8
/home/mmedina/lib/libssl.a(s3_lib.o)
<unknown>                           0x5cc       /home/mmedina/li
========================================================

Not sure what is going on here.  Can it not find my libraries?

Heikki Toivonen wrote:
> 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