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