diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ssl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c index b001bca..2fa6bd2 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -1706,6 +1706,10 @@ _ssl__SSLSocket_version_impl(PySSLSocket *self) if (self->ssl == NULL) Py_RETURN_NONE; + if (!SSL_is_init_finished(self->ssl)) { + /* handshake not finished */ + Py_RETURN_NONE; + } version = SSL_get_version(self->ssl); if (!strcmp(version, "unknown")) Py_RETURN_NONE; |