summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2022-07-03 13:38:20 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2022-07-03 16:37:59 +0900
commitda3e60dcc41ec2f66c915c8f406d3b523e4a4bb7 (patch)
tree8fdc18dabd3c7977a38d4458f544060843fb967e
parent5e2a999c98b7b331ff7926c9d924752fdd4a79df (diff)
downloadtdelibs-da3e60dcc41ec2f66c915c8f406d3b523e4a4bb7.tar.gz
tdelibs-da3e60dcc41ec2f66c915c8f406d3b523e4a4bb7.zip
KSSL: fixed detection of correct 'SSL_get_peer_certificate' method. This resolves incompatibility with openSSL 3.0.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 682b8acae4a983636bc178fbda25dfb5139b3716)
-rw-r--r--tdeio/kssl/kopenssl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tdeio/kssl/kopenssl.cpp b/tdeio/kssl/kopenssl.cpp
index a009bd7e9..312c85c17 100644
--- a/tdeio/kssl/kopenssl.cpp
+++ b/tdeio/kssl/kopenssl.cpp
@@ -635,7 +635,8 @@ TDEConfig *cfg;
K_SSLv3_client_method = (SSL_METHOD *(*)()) GET_SSLLIB_SYMBOL("SSLv3_client_method");
K_TLS_client_method = (SSL_METHOD *(*)()) GET_SSLLIB_SYMBOL("TLS_client_method");
if (!K_TLS_client_method) K_TLS_client_method = (SSL_METHOD *(*)()) GET_SSLLIB_SYMBOL("SSLv23_client_method");
- K_SSL_get_peer_certificate = (X509 *(*)(SSL *)) GET_SSLLIB_SYMBOL("SSL_get_peer_certificate");
+ K_SSL_get_peer_certificate = (X509 *(*)(SSL *)) GET_SSLLIB_SYMBOL("SSL_get1_peer_certificate");
+ if (!K_SSL_get_peer_certificate) K_SSL_get_peer_certificate = (X509 *(*)(SSL *)) GET_SSLLIB_SYMBOL("SSL_get_peer_certificate");
K_SSL_CIPHER_get_bits = (int (*)(SSL_CIPHER *,int *)) GET_SSLLIB_SYMBOL("SSL_CIPHER_get_bits");
K_SSL_CIPHER_get_version = (char * (*)(SSL_CIPHER *)) GET_SSLLIB_SYMBOL("SSL_CIPHER_get_version");
K_SSL_CIPHER_get_name = (const char * (*)(SSL_CIPHER *)) GET_SSLLIB_SYMBOL("SSL_CIPHER_get_name");