diff options
-rw-r--r-- | docs/installation.rst | 8 | ||||
-rw-r--r-- | src/_cffi_src/build_openssl.py | 11 |
2 files changed, 17 insertions, 2 deletions
diff --git a/docs/installation.rst b/docs/installation.rst index 2c24d35d..a1b5642d 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -50,7 +50,7 @@ If you prefer to compile it yourself you'll need to have OpenSSL installed. You can compile OpenSSL yourself as well or use the binaries we build for our release infrastructure (`openssl-release`_). Be sure to download the proper version for your architecture and Python (2010 works for Python 2.6, 2.7, 3.3, -and 3.4 while 2015 is required for 3.5). Wherever you place your copy +and 3.4 while 2015 is required for 3.5 and above). Wherever you place your copy of OpenSSL you'll need to set the ``LIB`` and ``INCLUDE`` environment variables to include the proper locations. For example: @@ -59,8 +59,14 @@ to include the proper locations. For example: C:\> \path\to\vcvarsall.bat x86_amd64 C:\> set LIB=C:\OpenSSL-win64\lib;%LIB% C:\> set INCLUDE=C:\OpenSSL-win64\include;%INCLUDE% + C:\> set CRYPTOGRAPHY_WINDOWS_LINK_OPENSSL110=1 C:\> pip install cryptography +As of OpenSSL 1.1.0 the library names have changed from ``libeay32`` and +``ssleay32`` to ``libcrypto`` and ``libssl`` (matching their names on all other +platforms). Due to this change when linking against 1.1.0 you **must** set +``CRYPTOGRAPHY_WINDOWS_LINK_OPENSSL110`` or else installation will fail. + If you need to rebuild ``cryptography`` for any reason be sure to clear the local `wheel cache`_. diff --git a/src/_cffi_src/build_openssl.py b/src/_cffi_src/build_openssl.py index 416e1b39..4d2d2c6f 100644 --- a/src/_cffi_src/build_openssl.py +++ b/src/_cffi_src/build_openssl.py @@ -19,9 +19,18 @@ def _get_openssl_libraries(platform): os.environ.get("CRYPTOGRAPHY_OSX_NO_LINK_FLAGS") ) elif platform == "win32": + windows_link_openssl110 = os.environ.get( + "CRYPTOGRAPHY_WINDOWS_LINK_OPENSSL110", None + ) if compiler_type() == "msvc": - libs = ["libeay32", "ssleay32"] + if windows_link_openssl110 is not None: + # Link against the 1.1.0 names + libs = ["libssl", "libcrypto"] + else: + # Link against the 1.0.2 and lower names + libs = ["libeay32", "ssleay32"] else: + # Support mingw, which behaves unix-like and prefixes "lib" libs = ["ssl", "crypto"] return libs + ["advapi32", "crypt32", "gdi32", "user32", "ws2_32"] else: |