allow timeout to be zero, better error message in SSL handling