diff options
author | June McEnroe <june@causal.agency> | 2021-07-04 08:49:26 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-07-04 19:45:33 -0400 |
commit | bf7b88a9914343808cc010487bc7461296a45499 (patch) | |
tree | c153fe6bc34825c042589726481b62790a9894d3 | |
parent | Save invited channel for /join (diff) | |
download | catgirl-bf7b88a9914343808cc010487bc7461296a45499.tar.gz catgirl-bf7b88a9914343808cc010487bc7461296a45499.zip |
Explicitly tls_handshake(3) in ircPrintCert
Otherwise we won't have any certificate to print yet, as reported by Klemens Nanni. Fixes 981ebc4f12b88fbf52ed0352428a0612dd2c2568.
Diffstat (limited to '')
-rw-r--r-- | irc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/irc.c b/irc.c index dc40201..5f14c9e 100644 --- a/irc.c +++ b/irc.c @@ -166,6 +166,12 @@ int ircConnect(const char *bindHost, const char *host, const char *port) { } void ircPrintCert(void) { + int error; + 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)); + size_t len; const byte *pem = tls_peer_cert_chain_pem(client, &len); printf("subject= %s\n", tls_peer_cert_subject(client)); |