close socket upon CertificateError