如何判断源代码构建的python是否启用了SSL?或
语境:
Bur*_*lid 13
如果您想要做的就是确定是否openssl已安装,您可以解析输出openssl version:
$ openssl version
OpenSSL 1.0.2g-fips 1 Mar 2016
Run Code Online (Sandbox Code Playgroud)
您可以从例如其存储的目录中获取各种信息version:
$ openssl version -d
OPENSSLDIR: "/usr/lib/ssl"
Run Code Online (Sandbox Code Playgroud)
就Python而言,我不确定在运行configure之前你怎么知道(也许检查一下config.log?的内容)但是一旦安装了Python; 简单地解析输出ssl.OPENSSL_VERSION,如下所示:
$ python -c "import ssl; print(ssl.OPENSSL_VERSION)"
OpenSSL 1.0.2g-fips 1 Mar 2016
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请参阅sysconfig模块,例如:
$ python -c "import sysconfig; print(sysconfig.get_config_var('CONFIG_ARGS'))"
'--enable-shared' '--prefix=/usr' '--enable-ipv6' '--enable-unicode=ucs4' '--with-dbmliborder=bdb:gdbm' '--with-system-expat' '--with-computed-gotos' '--with-system-ffi' '--with-fpectl' 'CC=x86_64-linux-gnu-gcc' 'CFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security ' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2435 次 |
| 最近记录: |