From 0c211e2852ba269aab8b95b473f4039881c04d32 Mon Sep 17 00:00:00 2001 From: Adam Potolsky Date: Tue, 9 Jun 2015 14:07:42 -0700 Subject: [PATCH] Adding logging output when ssl connects for aid in debugging and support --- src/lib/plugin/ns/SecureSocket.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/lib/plugin/ns/SecureSocket.cpp b/src/lib/plugin/ns/SecureSocket.cpp index 9d1c10f5..40c8b46d 100644 --- a/src/lib/plugin/ns/SecureSocket.cpp +++ b/src/lib/plugin/ns/SecureSocket.cpp @@ -298,6 +298,14 @@ SecureSocket::secureAccept(int socket) if (retry == 0) { m_secureReady = true; LOG((CLOG_INFO "accepted secure socket")); + const SSL_CIPHER* cipher = SSL_get_current_cipher(m_ssl->m_ssl); + if(cipher != NULL) { + char * cipherVersion = SSL_CIPHER_description(cipher, NULL, 0); + if(cipherVersion != NULL) { + LOG((CLOG_INFO "%s", cipherVersion)); + OPENSSL_free(cipherVersion); + } + } return 1; } @@ -355,6 +363,14 @@ SecureSocket::secureConnect(int socket) return -1; // Fingerprint failed, error } LOG((CLOG_DEBUG2 "connected secure socket")); + const SSL_CIPHER* cipher = SSL_get_current_cipher(m_ssl->m_ssl); + if(cipher != NULL) { + char * cipherVersion = SSL_CIPHER_description(cipher, NULL, 0); + if(cipherVersion != NULL) { + LOG((CLOG_INFO "%s", cipherVersion)); + OPENSSL_free(cipherVersion); + } + } return 1; }