Updating openssl in python 2.7

前端 未结 6 1295
醉酒成梦
醉酒成梦 2020-11-22 15:17

wondering if someone may please explain how openssl works in python2.7. I\'m not sure if python got its own openssl or picks it up from local machine/env?

let me exp

6条回答
  •  暖寄归人
    2020-11-22 16:19

    The following worked for me. I was already able to update OpenSSL from 0.9.8zh to a 1.0.2o version, but python never accessed the newer version until found this suggestion to use pyenv to reinstall python (with 2.7.10, the version I wanted).

    brew update
    brew install pyenv
    
    echo 'eval "$(pyenv init -)"' >> .bashrc
    source .bashrc
    
    pyenv install 2.7.10
    pyenv global 2.7.10
    

    and then to check...

    python --version
    Python 2.7.10
    
    python -c 'import ssl; print ssl.OPENSSL_VERSION'
    OpenSSL 1.0.2o  27 Mar 2018
    

    I did have to reinstall python packages of course.

    Source: https://github.com/ianunruh/hvac/issues/75

提交回复
热议问题