openssl - 是否有 SSL_get_current_cipher 的 pyOpenSSL 包装器?

标签 openssl pyopenssl

这是一种获取用于连接的实际密码套件的方法吗? get_cipher_list 似乎返回客户端(或服务器)支持的“可能”密码套件。

最佳答案

from OpenSSL._util import (
ffi as _ffi,
lib as _lib)

...

c_cipher_obj = _lib.SSL_get_current_cipher(con._ssl)
cur_cipher = _ffi.string( _lib.SSL_CIPHER_get_name(c_cipher_obj))

其中“con”是已用于连接到服务器或进行握手的 OpenSSL.SSL.Connection 对象。

我不知道为什么pyOpenSSL开发者没有添加这个方法。 M2Crypto 确实有它。

关于openssl - 是否有 SSL_get_current_cipher 的 pyOpenSSL 包装器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18403403/

相关文章:

c++ - OpenSSl RAND_bytes 多久返回一次错误,因为缺乏不可预测性?

c++ - 将 DER 编码的 X509 证书缓冲区转换为 Windows CERT_CONTEXT 结构

python - 使用 pyOpenSSL 从证书或其他连接信息中提取公钥

python - 无法连接到雪花

Python Confluence-Kafka SSL 配置

ssl - 带有延迟的扭曲 SNI

python - 从证书中获取主题 key 标识符

ios - 在 Xcode 4.3 上为模拟器构建 OpenSSL 失败

openssl - SSL 错误证书主题名称与 github.com 的目标主机不匹配

交叉编译 "OpenSSL"错误