remove useless clause
fix: handle case where socket is none for ssl