summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/relay.c
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2018-06-10 20:41:48 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2018-06-10 20:41:48 +0000
commit6525993e49f6ff078e1fb392c33631747ad83c56 (patch)
tree727a03582d90ba4d649319c3c950ed3b7ea3cdf8 /usr.sbin/relayd/relay.c
parent4d2751f65218b93a1910f5beeb4ce507196f4b86 (diff)
When a TLS error occurs, print the tls_error() message as part of the
connection closed log message, not just as debug message. ok claudio@ reyk@
Diffstat (limited to 'usr.sbin/relayd/relay.c')
-rw-r--r--usr.sbin/relayd/relay.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/relayd/relay.c b/usr.sbin/relayd/relay.c
index bc2bdd1582e..9a7f60d6f86 100644
--- a/usr.sbin/relayd/relay.c
+++ b/usr.sbin/relayd/relay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay.c,v 1.238 2018/04/18 12:10:54 claudio Exp $ */
+/* $OpenBSD: relay.c,v 1.239 2018/06/10 20:41:47 benno Exp $ */
/*
* Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -2304,6 +2304,7 @@ relay_tls_handshake(int fd, short event, void *arg)
struct relay *rlay = con->se_relay;
int retry_flag = 0;
int ret;
+ char *msg;
if (event == EV_TIMEOUT) {
relay_close(con, "TLS handshake timeout");
@@ -2355,10 +2356,13 @@ relay_tls_handshake(int fd, short event, void *arg)
} else if (ret == TLS_WANT_POLLOUT) {
retry_flag = EV_WRITE;
} else {
- log_debug("TLS handshake failed: %s: %s: %s",
- rlay->rl_conf.name, __func__,
- tls_error(cre->tls));
- relay_close(con, "TLS handshake error");
+ if (asprintf(&msg, "TLS handshake error: %s",
+ tls_error(cre->tls)) >= 0) {
+ relay_close(con, msg);
+ free(msg);
+ } else {
+ relay_close(con, "TLS handshake error");
+ }
return;
}