Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Fix SSL on Debian 9 (#19070)
Browse files Browse the repository at this point in the history
Debian 9 has dropped support for SSLv3 and so they have bumped their soname to
libssl.so.1.0.2.
This change adds lookup for that soname and also makes SSLv3_method optional.
  • Loading branch information
janvorli committed Apr 28, 2017
1 parent 91ab54f commit 4d7ee84
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
Expand Up @@ -25,6 +25,12 @@ bool OpenLibrary()
libssl = dlopen("libssl.so.10", RTLD_LAZY);
}

if (libssl == nullptr)
{
// Debian 9 has dropped support for SSLv3 and so they have bumped their soname
libssl = dlopen("libssl.so.1.0.2", RTLD_LAZY);
}

return libssl != nullptr;
}

Expand Down
Expand Up @@ -280,7 +280,7 @@ int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
PER_FUNCTION_BLOCK(SSL_shutdown, true) \
PER_FUNCTION_BLOCK(SSL_state, true) \
PER_FUNCTION_BLOCK(SSLv23_method, true) \
PER_FUNCTION_BLOCK(SSLv3_method, true) \
PER_FUNCTION_BLOCK(SSLv3_method, false) \
PER_FUNCTION_BLOCK(SSL_write, true) \
PER_FUNCTION_BLOCK(TLSv1_1_method, true) \
PER_FUNCTION_BLOCK(TLSv1_2_method, true) \
Expand Down
14 changes: 8 additions & 6 deletions src/Native/Unix/System.Security.Cryptography.Native/pal_ssl.cpp
Expand Up @@ -29,13 +29,15 @@ extern "C" const SSL_METHOD* CryptoNative_SslV2_3Method()

extern "C" const SSL_METHOD* CryptoNative_SslV3Method()
{
#ifdef OPENSSL_NO_SSL3_METHOD
return nullptr;
#else
const SSL_METHOD* method = SSLv3_method();
assert(method != nullptr);
return method;
const SSL_METHOD* method = nullptr;
#ifndef OPENSSL_NO_SSL3_METHOD
if (API_EXISTS(SSLv3_method))
{
method = SSLv3_method();
assert(method != nullptr);
}
#endif
return method;
}

extern "C" const SSL_METHOD* CryptoNative_TlsV1Method()
Expand Down

0 comments on commit 4d7ee84

Please sign in to comment.