From 4ec4225cd52033eefecfb39c5c5daa8b63983319 Mon Sep 17 00:00:00 2001 From: Jianhui Zhao Date: Sat, 11 Sep 2021 01:28:24 +0800 Subject: [PATCH] feat: ssl: clearer error message Signed-off-by: Jianhui Zhao --- src/rtty.c | 8 +++----- src/ssl | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/rtty.c b/src/rtty.c index 3f6f4b9..0e810b7 100644 --- a/src/rtty.c +++ b/src/rtty.c @@ -393,7 +393,7 @@ static int ssl_negotiated(struct rtty *rtty) return 0; if (ret == SSL_ERROR) { - log_err("ssl connect error(%d): %s\n", ssl_err_code, ssl_strerror(ssl_err_code, err_buf, sizeof(err_buf))); + log_err("ssl connect error: %s\n", ssl_last_error_string(err_buf, sizeof(err_buf))); return -1; } @@ -413,8 +413,7 @@ static int rtty_ssl_read(int fd, void *buf, size_t count, void *arg) ret = ssl_read(rtty->ssl, buf, count); if (ret == SSL_ERROR) { - log_err("ssl_read(%d): %s\n", ssl_err_code, - ssl_strerror(ssl_err_code, err_buf, sizeof(err_buf))); + log_err("ssl_read: %s\n", ssl_last_error_string(err_buf, sizeof(err_buf))); return P_FD_ERR; } @@ -490,8 +489,7 @@ static void on_net_write(struct ev_loop *loop, struct ev_io *w, int revents) ret = ssl_write(rtty->ssl, buffer_data(b), buffer_length(b)); if (ret == SSL_ERROR) { - log_err("ssl_write(%d): %s\n", ssl_err_code, - ssl_strerror(ssl_err_code, err_buf, sizeof(err_buf))); + log_err("ssl_write: %s\n", ssl_last_error_string(err_buf, sizeof(err_buf))); goto err; } diff --git a/src/ssl b/src/ssl index 07e77fe..a4e04c6 160000 --- a/src/ssl +++ b/src/ssl @@ -1 +1 @@ -Subproject commit 07e77fe0e6784ff44a53ed284ee1d998c066c860 +Subproject commit a4e04c691ebb3a42e0511e4addc1de775fa93a7e