cryptography icon indicating copy to clipboard operation
cryptography copied to clipboard

MacOS Homebrew evil linking bug (with fix)

Open mike805 opened this issue 11 years ago • 2 comments

Here is a nasty bug that took a few hours to find. MacOS 10.9, Homebrew, using the Homebrew version of Python 2.7 and OpenSSL 1.0.2, installing cryptography via pip. TLS_v1_2_METHOD mysteriously refuses to work, even though the OpenSSL under /usr/local/Cellar obviously supports it.

Turns out that cryptography links against the old-and-busted OpenSSL included by Apple, instead of the one under Homebrew. I had to do:

brew install openssl pip uninstall cryptography pip install --global-option=build_ext
--global-option="-I/usr/local/Cellar/openssl/1.0.2/include"
--global-option=build_ext
--global-option="-L/usr/local/Cellar/openssl/1.0.2/lib"
cryptography

and now my program works.

mike805 avatar Jan 26 '15 10:01 mike805

Have you tried the solution listed in the docs: https://cryptography.io/en/latest/installation/#using-your-own-openssl-on-os-x?

Ayrx avatar Jan 26 '15 11:01 Ayrx

This issue is documented along with a workaround in the docs as @Ayrx mentioned. I'm going to go ahead and close this, but feel free to reopen if you think the solution we've documented doesn't work for you.

reaperhulk avatar Jan 26 '15 13:01 reaperhulk