From 7528b8ea805154bcc2218a45d761d0be97c48b02 Mon Sep 17 00:00:00 2001 From: Michael Ortmann <41313082+michaelortmann@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:11:14 +0100 Subject: [PATCH] Wait for ssl handshake to finish before trying to write to socket --- src/net.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/net.c b/src/net.c index 42be92b34..0ad95b43e 100644 --- a/src/net.c +++ b/src/net.c @@ -1402,7 +1402,11 @@ void dequeue_sockets() tv.tv_usec = 0; /* we only want to see if it's ready for writing, no need to actually wait.. */ for (i = 0; i < td->MAXSOCKS; i++) if (!(socklist[i].flags & (SOCK_UNUSED | SOCK_TCL)) && - (socklist[i].handler.sock.outbuf != NULL)) { + (socklist[i].handler.sock.outbuf != NULL) +#ifdef TLS + && !(socklist[i].ssl && !SSL_is_init_finished(socklist[i].ssl)) +#endif + ) { if (socklist[i].sock > maxfd) maxfd = socklist[i].sock; FD_SET(socklist[i].sock, &wfds);