Replace SSL_get_version().

This commit is contained in:
Jim Hague 2018-11-15 15:58:19 +00:00
parent 09019bee75
commit 4b8c9d1bd7
3 changed files with 16 additions and 1 deletions

View File

@ -342,6 +342,13 @@ _getdns_tls_session* _getdns_tls_connection_get_session(_getdns_tls_connection*
return res;
}
const char* _getdns_tls_connection_get_version(_getdns_tls_connection* conn)
{
if (!conn || !conn->ssl)
return NULL;
return SSL_get_version(conn->ssl);
}
getdns_return_t _getdns_tls_connection_do_handshake(_getdns_tls_connection* conn)
{
int r;

View File

@ -83,6 +83,14 @@ getdns_return_t _getdns_tls_connection_set_curves_list(_getdns_tls_connection* c
getdns_return_t _getdns_tls_connection_set_session(_getdns_tls_connection* conn, _getdns_tls_session* s);
_getdns_tls_session* _getdns_tls_connection_get_session(_getdns_tls_connection* conn);
/**
* Report the TLS version of the connection.
*
* @param conn the connection.
* @return string with the connection description, NULL on error.
*/
const char* _getdns_tls_connection_get_version(_getdns_tls_connection* conn);
/**
* Attempt TLS handshake.
*

View File

@ -1865,7 +1865,7 @@ upstream_write_cb(void *userarg)
cert, &netreq->debug_tls_peer_cert.data);
X509_free(cert);
}
netreq->debug_tls_version = SSL_get_version(netreq->upstream->tls_obj->ssl);
netreq->debug_tls_version = _getdns_tls_connection_get_version(netreq->upstream->tls_obj);
}
/* Need this because auth status is reset on connection close */
netreq->debug_tls_auth_status = netreq->upstream->tls_auth_state;