i think upgrade python will fix this issue or check with hostname give proper way like server.domain.com and see
update all apt-get update and reboot

    JAY I've done everything, but have not managed to fix this problem, is there another way, I use centos on GPC

    mubasir212
    run

    pip uninstall pyOpenSSL -y
    pip install pyOpenSSL

    and try again?

    2 months later

    i used pip uninstall pyopenSSL -y then install but getting error

    DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
    Looking in indexes: https://mirrors.aliyun.com/pypi/simple
    Collecting pyOpenSSL
    Downloading https://mirrors.aliyun.com/pypi/packages/01/c8/ceb170d81bd3941cbeb9940fc6cc2ef2ca4288d0ca8929ea4db5905d904d/pyOpenSSL-19.0.0-py2.py3-none-any.whl (53kB)
    |████████████████████████████████| 61kB 49.8MB/s
    Requirement already satisfied: cryptography>=2.3 in /usr/lib64/python2.7/site-packages (from pyOpenSSL) (2.8)
    Requirement already satisfied: six>=1.5.2 in /usr/lib/python2.7/site-packages (from pyOpenSSL) (1.12.0)
    Requirement already satisfied: enum34; python_version < "3" in /usr/lib/python2.7/site-packages (from cryptography>=2.3->pyOpenSSL) (1.1.6)
    Requirement already satisfied: cffi!=1.11.3,>=1.8 in /usr/lib64/python2.7/site-packages (from cryptography>=2.3->pyOpenSSL) (1.13.1)
    Requirement already satisfied: ipaddress; python_version < "3" in /usr/lib/python2.7/site-packages (from cryptography>=2.3->pyOpenSSL) (1.0.16)
    Requirement already satisfied: pycparser in /usr/lib/python2.7/site-packages (from cffi!=1.11.3,>=1.8->cryptography>=2.3->pyOpenSSL) (2.19)
    Installing collected packages: pyOpenSSL
    Successfully installed pyOpenSSL-19.0.0