Hynek Schlawack | d52975c | 2017-05-13 17:44:27 +0200 | [diff] [blame^] | 1 | from __future__ import print_function |
| 2 | |
| 3 | import ssl |
| 4 | import sys |
| 5 | |
| 6 | import OpenSSL.SSL |
| 7 | import cffi |
| 8 | import cryptography |
| 9 | |
| 10 | from . import version |
| 11 | |
| 12 | |
| 13 | _env_info = u"""\ |
| 14 | pyOpenSSL: {pyopenssl} |
| 15 | cryptography: {cryptography} |
| 16 | cffi: {cffi} |
| 17 | cryptography's compiled against OpenSSL: {crypto_openssl_compile} |
| 18 | cryptography's linked OpenSSL: {crypto_openssl_link} |
| 19 | Pythons's OpenSSL: {python_openssl} |
| 20 | Python executable: {python} |
| 21 | Python version: {python_version} |
| 22 | Platform: {platform} |
| 23 | sys.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 | |
| 41 | if __name__ == "__main__": |
| 42 | print(_env_info) |