Derek Zhou writes: > When this thing happens, the tls handshakes are done properly. However, > emacs did not write anything into gnutls before starting to read and > obviously cannot get anything out at all. It is not really a hang, but > write never happen and the display buffer stays empty. > > Derek Took my nearly the whole day to debug, but this one-line patch fixed my problem. My server finishes tls handshake within the gnutls_boot itself, and if the sentinel is not called right after, it will never be called so write will not happen. Someone should review this carefully.