         ] }
         ! https://stackoverflow.com/questions/13686398/ssl-read-failing-with-ssl-error-syscall-error
         ! 0 means EOF
-        { 0 [ premature-close-error f ] }
+        { 0 [ f ] }
     } case ;
 
 : check-ssl-error ( ssl-handle ret -- event/f )

    ] if* ;

M: ssl-handle drain
    dup maybe-handshake [ buffer>> ] dip do-ssl-write ;

! Connect

        { SSL_ERROR_SYSCALL [ ssl-error-syscall ] }
        { SSL_ERROR_SSL [ drop throw-ssl-error ] }
        ! https://stackoverflow.com/questions/50223224/ssl-read-returns-ssl-error-zero-return-but-err-get-error-is-0
        ! we got disconnected
        { SSL_ERROR_ZERO_RETURN [ f >>connected t >>terminated premature-close-error ] }
        { SSL_ERROR_WANT_ACCEPT [ drop +input+ ] }
    } case ;

