diff options
author | Determinant <[email protected]> | 2019-06-19 19:11:58 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2019-06-19 19:11:58 -0400 |
commit | 4f41e23016dc316334e7d6cc8765bdf334b96f3e (patch) | |
tree | 560ad5144e9bc4d7193b0db1ffebb86aca1d0d68 /src | |
parent | 8f42d0581a8e0cd77bde459db6b61fd957e19c1b (diff) |
more openssl wrappers
Diffstat (limited to 'src')
-rw-r--r-- | src/conn.cpp | 6 | ||||
-rw-r--r-- | src/util.cpp | 7 |
2 files changed, 9 insertions, 4 deletions
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"; |