diff options
| author | Nils Maier <maierman@web.de> | 2014-12-12 09:57:25 +0100 |
|---|---|---|
| committer | Nils Maier <maierman@web.de> | 2014-12-12 18:24:19 +0100 |
| commit | c5c38bf3a4f6193ecba814d47a305872b6ea5454 (patch) | |
| tree | b10e564ff8432bc8e2cf9d53f03ff2522b6c56f1 /src/LibsslTLSSession.cc | |
| parent | 811c0f758da0d161b278fc6b0da333459dd220b4 (diff) | |
Warn about insecure SSL connections.
Fixed GH-313
Diffstat (limited to 'src/LibsslTLSSession.cc')
| -rw-r--r-- | src/LibsslTLSSession.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/LibsslTLSSession.cc b/src/LibsslTLSSession.cc index 04d01214..9a62a09b 100644 --- a/src/LibsslTLSSession.cc +++ b/src/LibsslTLSSession.cc @@ -267,6 +267,26 @@ int OpenSSLTLSSession::tlsConnect(const std::string& hostname, return TLS_ERR_ERROR; } } + + switch(SSL_version(ssl_)) { + case SSL3_VERSION: + case SSL2_VERSION: { + std::string protoAndSuite = "Unknown"; + auto cipher = SSL_get_current_cipher(ssl_); + if(cipher) { + auto buf = make_unique<char[]>(256); + auto cipherstr = SSL_CIPHER_description(cipher, buf.get(), 256); + if(cipherstr) { + protoAndSuite = cipherstr; + } + } + A2_LOG_WARN(fmt(MSG_WARN_OLD_TLS_CONNECTION, protoAndSuite.c_str())); + break; + } + default: + break; + } + return TLS_ERR_OK; } |
