summary refs log tree commit diff
diff options
context:
space:
mode:
authorKlemens Nanni <klemens@posteo.de>2021-06-29 12:24:14 +0000
committerJune McEnroe <june@causal.agency>2021-07-13 15:17:22 -0400
commit40b3f52aaf52ea48646d3e17ffeebf9883ccd95a (patch)
tree6f0c19728cf0c113bf66771321764593a3b0eb13
parentFreeBSD: Avoid caph_stream_rights(3) (diff)
downloadcatgirl-40b3f52aaf52ea48646d3e17ffeebf9883ccd95a.tar.gz
catgirl-40b3f52aaf52ea48646d3e17ffeebf9883ccd95a.zip
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.
-rw-r--r--irc.c5
1 files changed, 5 insertions, 0 deletions
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;
 }
 
9 -0400'>2020-09-11Use MacPorts rather than pkgsrcJune McEnroe My system is probably such a mess now... 2020-09-11Add debian VM name to sshJune McEnroe 2020-09-11Add influencer tweetJune McEnroe 2020-09-10Add The Kingdom of GodsJune McEnroe Reading has really slowed down :( 2020-09-07Add SunglassesJune McEnroe An IRC find. 2020-09-06Add Between the BreathsJune McEnroe One of those good songs from a soundtrack of a film that probably isn't? The summary sounds a lot more interesting than the title implies, at least. 2020-09-04Open /dev/tty in nudgeJune McEnroe This makes it work even when it's run connected to a pipe, i.e. as the notify command of catgirl... 2020-09-04Add nudgeJune McEnroe 2020-09-03Build fbclock with -lzJune McEnroe I guess this got lost somewhere, long ago... 2020-08-29Add tweets from retweetsJune McEnroe