Hi, For latest master branch, when try to use gnutls with async connection, the handshake will return fatal error if socket is in ENOTCONN or EINPROGRESS since gnutls treat these errors as fatal during push/pull and gives up. The later retry will fail because gnutls will mark the session invalid. This patch is asking gnutls to treat them as EAGAIN which is non-fatal. I only tested with OSX. Please see if you can reproduce it on Windows or Linux and if this patch works for them too. To reproduce run: emacs -Q --eval "(erc-tls :server \"irc.freenode.net\" :port 6697 :nick \"test\")" Current master branch will gave up connecting. -- Thanks - Jun