Added functionality to fetch the TLS version and cipher info for a connection.

This commit is contained in:
Jan Vidar Krey
2014-08-05 17:43:24 +02:00
parent b3b4876c08
commit 95de69efeb
2 changed files with 15 additions and 1 deletions

View File

@@ -394,6 +394,18 @@ void net_ssl_callback(struct net_connection* con, int events)
}
}
const char* net_ssl_get_tls_version(struct net_connection* con)
{
struct net_ssl_openssl* handle = get_handle(con);
return SSL_get_version(handle->ssl);
}
const char* net_ssl_get_tls_cipher(struct net_connection* con)
{
struct net_ssl_openssl* handle = get_handle(con);
const SSL_CIPHER *cipher = SSL_get_current_cipher(handle->ssl);
return SSL_CIPHER_get_name(cipher);
}
#endif /* SSL_USE_OPENSSL */
#endif /* SSL_SUPPORT */