mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
openssl: remove get_ssl_version_txt in favor of SSL_get_version
openssl: use SSL_get_version to get connection protocol Replace our bespoke get_ssl_version_txt in favor of SSL_get_version. We can get rid of few lines of code, since SSL_get_version achieve the exact same thing Closes #6665 Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Signed-off-by: Jean-Philippe Menil <jpmenil@gmail.com>
This commit is contained in:
parent
09a5bff1c9
commit
8779bfe77b
@ -2254,35 +2254,6 @@ select_next_proto_cb(SSL *ssl,
|
|||||||
}
|
}
|
||||||
#endif /* HAS_NPN */
|
#endif /* HAS_NPN */
|
||||||
|
|
||||||
#ifndef CURL_DISABLE_VERBOSE_STRINGS
|
|
||||||
static const char *
|
|
||||||
get_ssl_version_txt(SSL *ssl)
|
|
||||||
{
|
|
||||||
if(!ssl)
|
|
||||||
return "";
|
|
||||||
|
|
||||||
switch(SSL_version(ssl)) {
|
|
||||||
#ifdef TLS1_3_VERSION
|
|
||||||
case TLS1_3_VERSION:
|
|
||||||
return "TLSv1.3";
|
|
||||||
#endif
|
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x1000100FL
|
|
||||||
case TLS1_2_VERSION:
|
|
||||||
return "TLSv1.2";
|
|
||||||
case TLS1_1_VERSION:
|
|
||||||
return "TLSv1.1";
|
|
||||||
#endif
|
|
||||||
case TLS1_VERSION:
|
|
||||||
return "TLSv1.0";
|
|
||||||
case SSL3_VERSION:
|
|
||||||
return "SSLv3";
|
|
||||||
case SSL2_VERSION:
|
|
||||||
return "SSLv2";
|
|
||||||
}
|
|
||||||
return "unknown";
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) /* 1.1.0 */
|
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) /* 1.1.0 */
|
||||||
static CURLcode
|
static CURLcode
|
||||||
set_ssl_version_min_max(SSL_CTX *ctx, struct connectdata *conn)
|
set_ssl_version_min_max(SSL_CTX *ctx, struct connectdata *conn)
|
||||||
@ -3386,7 +3357,7 @@ static CURLcode ossl_connect_step2(struct Curl_easy *data,
|
|||||||
|
|
||||||
/* Informational message */
|
/* Informational message */
|
||||||
infof(data, "SSL connection using %s / %s\n",
|
infof(data, "SSL connection using %s / %s\n",
|
||||||
get_ssl_version_txt(backend->handle),
|
SSL_get_version(backend->handle),
|
||||||
SSL_get_cipher(backend->handle));
|
SSL_get_cipher(backend->handle));
|
||||||
|
|
||||||
#ifdef HAS_ALPN
|
#ifdef HAS_ALPN
|
||||||
|
Loading…
Reference in New Issue
Block a user