如何为google-app-engine设置SSL模块?

时间:2010-04-22 06:04:25

标签: google-app-engine ssl

我已逐步跟踪this,并在cdbuild\lib.win32-2.5时导入成功。

如何在其他文件夹上运行python时如何成功导入?

1 个答案:

答案 0 :(得分:2)

修改:关于您遇到的错误cannot find -lgw32c,您只需下载libgw32c <{3}} step by step guide >

=&GT;开发者版!! (不是二进制文件,也不是源文件)

我也尝试用mingw32编译

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>

导入确定

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']
>>>

更新:第二个问题

  

我的新问题是:如何导入它   当我运行'python'时成功   其他的dirs?

在我的示例中,我只做python setup.py build -c mingw32,您需要使用

进行安装
python setup.py install

只需将ssl文件夹从build\lib.win32-2.5复制到D:\Python25\Lib\site-packages\

即可