pythonmacosopenssltravis-citravis-ci-cli

Use OpenSSL 1.0.2 in Python (on Travis CI OSX image)?


I have OpenSSL 1.0.2 installed.

$ openssl version
OpenSSL 1.0.2n  7 Dec 2017

Exported compiler flags as advised.

before_install:
- export PATH="/usr/local/opt/openssl/bin:$PATH"
- export LDFLAGS="$LDFLAGS -L/usr/local/opt/openssl/lib"
- export CPPFLAGS="$CPPFLAGS -I/usr/local/opt/openssl/include"

Still, Python sees OpenSSL 0.9.8 only. 😢

$ python -c 'import ssl; print ssl.OPENSSL_VERSION;'
OpenSSL 0.9.8zh 14 Jan 2016

So later on, when I try to run this Python script, it says:

ERROR: Your Python's OpenSSL library is outdated (OpenSSL 0.9.8zh 14 Jan 2016).

How can I fix the OpenSSL reference in Python?


I tried a whole lot of things: https://github.com/eppz/Unity.Test.eppz/commits/master/.travis.yml


Solution

  • Use python2 instead python to run scripts.

    You can try this simple ssl version check:

    $ python2 -c 'import ssl; print ssl.OPENSSL_VERSION;'
    OpenSSL 1.0.2m  2 Nov 2017