From 40b3f52aaf52ea48646d3e17ffeebf9883ccd95a Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Tue, 29 Jun 2021 12:24:14 +0000 Subject: Revert "Remove explicit tls_handshake(3) from ircConnect" This reverts commit 981ebc4f12b88fbf52ed0352428a0612dd2c2568. This broke `-o' to print the server certificate; without explicit handshake there will be no tls_read(3) in this short code path. --- irc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/irc.c b/irc.c index dc40201..61d74bb 100644 --- a/irc.c +++ b/irc.c @@ -162,6 +162,11 @@ int ircConnect(const char *bindHost, const char *host, const char *port) { error = tls_connect_socket(client, sock, host); if (error) errx(EX_PROTOCOL, "tls_connect: %s", tls_error(client)); + do { + error = tls_handshake(client); + } while (error == TLS_WANT_POLLIN || error == TLS_WANT_POLLOUT); + if (error) errx(EX_PROTOCOL, "tls_handshake: %s", tls_error(client)); + return sock; } -- cgit 1.4.1