Skip to content

Commit

Permalink
Replace OPENSSL_VERSION_NUMBER check with defined(TLS1_3_VERSION) che…
Browse files Browse the repository at this point in the history
…ck for TLS v1.3 compatibility

This provides compatibility with other SSL libraries like LibreSSL
with different semantics of OPENSSL_VERSION_NUMBER.
  • Loading branch information
LINKIWI authored and dormando committed Nov 24, 2021
1 parent 32eab46 commit 3723c2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -4049,7 +4049,7 @@ static void usage(void) {
printf(" - ssl_session_cache: enable server-side SSL session cache, to support session\n"
" resumption\n"
" - ssl_min_version: minimum protocol version to accept (default: %s)\n"
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
#if defined(TLS1_3_VERSION)
" valid values are 0(%s), 1(%s), 2(%s), or 3(%s).\n",
ssl_proto_text(settings.ssl_min_version),
ssl_proto_text(TLS1_VERSION), ssl_proto_text(TLS1_1_VERSION),
Expand Down Expand Up @@ -5455,7 +5455,7 @@ int main (int argc, char **argv) {
case 2:
settings.ssl_min_version = TLS1_2_VERSION;
break;
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
#if defined(TLS1_3_VERSION)
case 3:
settings.ssl_min_version = TLS1_3_VERSION;
break;
Expand Down
2 changes: 1 addition & 1 deletion tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ const char *ssl_proto_text(int version) {
return "tlsv1.1";
case TLS1_2_VERSION:
return "tlsv1.2";
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
#if defined(TLS1_3_VERSION)
case TLS1_3_VERSION:
return "tlsv1.3";
#endif
Expand Down

0 comments on commit 3723c2a

Please sign in to comment.