summarylogtreecommitdiffstats
path: root/openssl-fix.patch
blob: 7ed7f54f644b3cda0d167f2fc31410e4740641b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff --git a/src/lib/net/SecureSocket.cpp b/src/lib/net/SecureSocket.cpp
index 7076c764e..1e35c216f 100644
--- a/src/lib/net/SecureSocket.cpp
+++ b/src/lib/net/SecureSocket.cpp
@@ -805,10 +805,15 @@ SecureSocket::showSecureCipherInfo()
 		showCipherStackDesc(sStack);
 	}
 
-	// m_ssl->m_ssl->session->ciphers is not forward compatable, In future release
-	// of OpenSSL, it's not visible, need to use SSL_get_client_ciphers() instead
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+	// m_ssl->m_ssl->session->ciphers is not forward compatable,
+	// In future release of OpenSSL, it's not visible,
 	STACK_OF(SSL_CIPHER) * cStack = m_ssl->m_ssl->session->ciphers;
-		if (cStack == NULL) {
+#else
+	// Use SSL_get_client_ciphers() for newer versions
+	STACK_OF(SSL_CIPHER) * cStack = SSL_get_client_ciphers(m_ssl->m_ssl);
+#endif
+	if (cStack == NULL) {
 		LOG((CLOG_DEBUG1 "remote cipher list not available"));
 	}
 	else {