aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/conn.cpp6
-rw-r--r--src/util.cpp7
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";