From 4f41e23016dc316334e7d6cc8765bdf334b96f3e Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 19 Jun 2019 19:11:58 -0400 Subject: more openssl wrappers --- src/conn.cpp | 6 ++++-- src/util.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/conn.cpp b/src/conn.cpp index 3ec4284..60d5835 100644 --- a/src/conn.cpp +++ b/src/conn.cpp @@ -211,19 +211,21 @@ void ConnPool::Conn::_recv_data_tls(const ConnPool::conn_t &conn, int fd, int ev conn->on_read(); } -void ConnPool::Conn::_send_data_tls_handshake(const ConnPool::conn_t &conn, int fd, int events) { +void ConnPool::Conn::_send_data_tls_handshake(const ConnPool::conn_t &conn, int, int) { int ret; if (conn->tls->do_handshake(ret)) { + /* finishing TLS handshake */ conn->send_data_func = _send_data_tls; conn->recv_data_func = _recv_data_tls; + conn->peer_cert = new X509(conn->tls->get_peer_cert()); conn->cpool->update_conn(conn, true); } else { conn->ev_socket.del(); conn->ev_socket.add(ret == 0 ? FdEvent::READ : FdEvent::WRITE); - SALTICIDAE_LOG_INFO("tls handshake %d", ret); + SALTICIDAE_LOG_DEBUG("tls handshake %s", ret == 0 ? "read" : "write"); } } diff --git a/src/util.cpp b/src/util.cpp index fde326a..66bcd12 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -49,8 +49,11 @@ const char *SALTICIDAE_ERROR_STRINGS[] = { "configuration file line too long", "invalid option format", "unable to load cert", - "uable to load key", - "tls generic error" + "unable to load key", + "tls generic error", + "x509 cert error", + "EVP_PKEY error", + "unknown error" }; const char *TTY_COLOR_RED = "\x1b[31m"; -- cgit v1.2.3-70-g09d2