Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/vtls/openssl: remove get_ssl_version_txt in favor of SSL_get_version #6665

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 1 addition & 30 deletions lib/vtls/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2254,35 +2254,6 @@ select_next_proto_cb(SSL *ssl,
}
#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 */
static CURLcode
set_ssl_version_min_max(SSL_CTX *ctx, struct connectdata *conn)
Expand Down Expand Up @@ -3386,7 +3357,7 @@ static CURLcode ossl_connect_step2(struct Curl_easy *data,

/* Informational message */
infof(data, "SSL connection using %s / %s\n",
get_ssl_version_txt(backend->handle),
SSL_get_version(backend->handle),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenSSL supports this all the way back to 0.9.8 so this seems like a neat simplification.

SSL_get_cipher(backend->handle));

#ifdef HAS_ALPN
Expand Down