MacOS Homebrew evil linking bug (with fix)
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.
Have you tried the solution listed in the docs: https://cryptography.io/en/latest/installation/#using-your-own-openssl-on-os-x?
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.