2

我正在 Python 2.7.8 下开发。里面的 _ssl.pyd 是用 OpenSSL 1.0.1h 构建的。

但是,我也有 pyOpenSSL 0.10(我知道,旧版本)来满足所需的依赖。pyOpenSSL 包括 libeay32.dll 和 ssleay32.dll 版本 0.9.8o。

这有什么关系?是因为 pyOpenSSL 提供了 OpenSSL 库的直接接口吗?

4

1 回答 1

2

Python may be compiled with OpenSSL support which is required for internal libraries like TLS/SSL (https://docs.python.org/3.4/library/ssl.html) or urllib. The internal Python ssl library implements SSL protocol over sockets. urllib use it for https protocol, for example.

pyOpenSSL is another Python library that you can find on Pypi. It has been created to provide a full support of OpenSSL lib as the internal Python SSL module still not cover all functionalities.

So, it is not part of Python internal libraries. It implements a high level interface over openssl library. You have to compile/install it outside Python scope. So it may be compiled using another version than the openssl lib used by Python.

More, on Windows, you will install it using a binary package, so the OpenSSL dll with which it has been compiled are provided; so they may be different than the one installed on the system or by Python.

Yes pyOpenSLL does direct interface to OpenSSL lib. The tests scripts also execute the openssl command line tool, but not the Python files of the lib when having a quick look at version 0.14 source files.

Hope it can help.

于 2014-10-30T08:24:19.993 回答