handling uncaught ssl read error. fixes #25