Edit: Regarding the error you got cannot find -lgw32c
, you simply need to download libgw32c, which is mentioned in dependencies list on your step by step guide
I tried to compile with mingw32 too
D:\tmp\ssl-1.15> python setup.py build -c mingw32
running build
running build_py
running build_ext
building 'ssl._ssl2' extension
writing build\temp.win32-2.5\Release\ssl\_ssl2.def
gcc.exe -mno-cygwin -shared -s build\temp.win32-2.5\Release\ssl\_ssl2.o build\temp.win32-2.5\Release\ssl\_ssl2.def -LC:\Utils\GnuWin32\lib -LD:\Python25\libs -LD:\Python25\PCBuild -lssl -lcrypto -lwsock32 -lgdi32 -lgw32c -lole32 -luuid -lpython25 -lmsvcr71 -o build\lib.win32-2.5\ssl\_ssl2.pyd -static
D:\tmp\ssl-1.15>
Importing ok
D:\tmp\ssl-1.15\build\lib.win32-2.5> python
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> dir(ssl)
['CERT_NONE', 'CERT_OPTIONAL', 'CERT_REQUIRED', 'DER_cert_to_PEM_cert', 'PEM_FOOTER', 'PEM_HEADER', 'PEM_cert_to_DER_cert', 'PROTOCOL_NOSSLv2', 'PROTOCOL_SSLv2', 'PROTOCOL_SSLv23', 'PROTOCOL_SSLv3', 'PROTOCOL_TLSv1', 'RAND_add', 'RAND_egd', 'RAND_status', 'SSLError', 'SSLSocket', 'SSL_ERROR_EOF', 'SSL_ERROR_INVALID_ERROR_CODE', 'SSL_ERROR_SSL', 'SSL_ERROR_SYSCALL', 'SSL_ERROR_WANT_CONNECT', 'SSL_ERROR_WANT_READ', 'SSL_ERROR_WANT_WRITE', 'SSL_ERROR_WANT_X509_LOOKUP', 'SSL_ERROR_ZERO_RETURN', '__builtins__', '__doc__', '__file__', '__name__', '__path__', '_fileobject', '_getnameinfo', '_ssl2', 'base64', 'cert_time_to_seconds', 'get_protocol_name', 'get_server_certificate', 'os', 'select', 'socket', 'sslwrap_simple', 'sys', 'wrap_socket']
>>>
Update: for the second question
my new problem is : how to import it
successful when i run 'python' on
other dirs?
In my example, I only did python setup.py build -c mingw32
, you need to install it by using
python setup.py install
or
Just copy ssl
folder from build\lib.win32-2.5
to D:\Python25\Lib\site-packages\