How to update OpenSSL on mac?

前端 未结 2 735
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-20 12:50

I need to ensure that I have OpenSSL version of 1.0.1 or greater to connect to the Salesforce API according to this documentation.

According to this question, I can

2条回答
  •  难免孤独
    2020-12-20 13:05

    I think this is a multi-part issue with the versions of Python you are using and your $PATH variable.

    First check where you're looking for Python by using this command in the terminal:

    which python
    

    It should output something like this: /usr/local/bin/python

    Then check for the path that you have setup.

    echo $PATH
    

    Likely you're seeing something like:

    /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/username/anaconda/bin:/usr/bin:/bin:/usr/sbin:/sbin
    

    The issue is probably that the version of python tied to your default when you enter python in your terminal is not one that has the modern version of openssl.

    In other words:

    openssl version -a
    

    Is checking for openssl somewhere different than

    python -c "import ssl; print ssl.OPENSSL_VERSION"
    

    To fix this, you might try editing your $PATH variable.

    I suggest doing this by editing something like your ~/.bash_profile file. You can add something like this to specify a different Python binary to use:

    export PATH="/usr/local/bin:$PATH"
    

    Plop this on the end of your .bash_profile file and then whenever you're using bash it should look for Python in the /usr/local/bin directory before looking elsewhere. Keep in mind that this might also affect places that other programs look for Python (or other binaries).

提交回复
热议问题