From baf7c1e5466cb1be6378f6b9ed96f7288bef548d Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Wed, 7 Jan 2015 11:32:00 -0600 Subject: use SSL_get_session --- Modules/_ssl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 55f04ed..5969663 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -1404,13 +1404,14 @@ cipher_to_tuple(const SSL_CIPHER *cipher) static PyObject *PySSL_shared_ciphers(PySSLSocket *self) { + SSL_SESSION *sess = SSL_get_session(self->ssl); STACK_OF(SSL_CIPHER) *ciphers; int i; PyObject *res; - if (!self->ssl->session || !self->ssl->session->ciphers) + if (!sess || !sess->ciphers) Py_RETURN_NONE; - ciphers = self->ssl->session->ciphers; + ciphers = sess->ciphers; res = PyList_New(sk_SSL_CIPHER_num(ciphers)); if (!res) return NULL; -- cgit v0.12