diff options
author | louiz’ <louiz@louiz.org> | 2018-04-28 13:55:35 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2018-04-28 13:57:40 +0200 |
commit | d887baa064318fdb350fb6c3f7b8e2104a644fcb (patch) | |
tree | 2237903f9649cfea87a5a785477a1ca6a5144a26 /src | |
parent | f481e2f194d60e9be39ca44ede8d46717937451e (diff) | |
download | biboumi-d887baa064318fdb350fb6c3f7b8e2104a644fcb.tar.gz biboumi-d887baa064318fdb350fb6c3f7b8e2104a644fcb.tar.bz2 biboumi-d887baa064318fdb350fb6c3f7b8e2104a644fcb.tar.xz biboumi-d887baa064318fdb350fb6c3f7b8e2104a644fcb.zip |
Fix a crash when botan policy does not allow any available ciphersuitev7
Diffstat (limited to 'src')
-rw-r--r-- | src/network/tcp_client_socket_handler.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/network/tcp_client_socket_handler.cpp b/src/network/tcp_client_socket_handler.cpp index aac13d0..9dda73d 100644 --- a/src/network/tcp_client_socket_handler.cpp +++ b/src/network/tcp_client_socket_handler.cpp @@ -146,15 +146,22 @@ void TCPClientSocketHandler::connect(const std::string& address, const std::stri || errno == EISCONN) { log_info("Connection success."); +#ifdef BOTAN_FOUND + if (this->use_tls) + try { + this->start_tls(this->address, this->port); + } catch (const Botan::Exception& e) + { + this->on_connection_failed("TLS error: "s + e.what()); + this->close(); + return ; + } +#endif TimedEventsManager::instance().cancel("connection_timeout" + std::to_string(this->socket)); this->poller->add_socket_handler(this); this->connected = true; this->connecting = false; -#ifdef BOTAN_FOUND - if (this->use_tls) - this->start_tls(this->address, this->port); -#endif this->connection_date = std::chrono::system_clock::now(); // Get our local TCP port and store it |