1from __future__ import print_function 2 3import ssl 4import sys 5 6import OpenSSL.SSL 7import cffi 8import cryptography 9 10from . import version 11 12 13_env_info = u"""\ 14pyOpenSSL: {pyopenssl} 15cryptography: {cryptography} 16cffi: {cffi} 17cryptography's compiled against OpenSSL: {crypto_openssl_compile} 18cryptography's linked OpenSSL: {crypto_openssl_link} 19Python's OpenSSL: {python_openssl} 20Python executable: {python} 21Python version: {python_version} 22Platform: {platform} 23sys.path: {sys_path}""".format( 24 pyopenssl=version.__version__, 25 crypto_openssl_compile=OpenSSL._util.ffi.string( 26 OpenSSL._util.lib.OPENSSL_VERSION_TEXT, 27 ).decode("ascii"), 28 crypto_openssl_link=OpenSSL.SSL.SSLeay_version( 29 OpenSSL.SSL.SSLEAY_VERSION 30 ).decode("ascii"), 31 python_openssl=getattr(ssl, "OPENSSL_VERSION", "n/a"), 32 cryptography=cryptography.__version__, 33 cffi=cffi.__version__, 34 python=sys.executable, 35 python_version=sys.version, 36 platform=sys.platform, 37 sys_path=sys.path, 38) 39 40 41if __name__ == "__main__": 42 print(_env_info) 43