if ((err = SSL_connect (data->ssl)) < 0)
if ((err = SSL_connect (data->ssl)) != 1)
int ssl_socket_open (CONNECTION * conn){  sslsockdata *data;  int err;  if (raw_socket_open (conn) < 0)    return -1;  data = (sslsockdata *) safe_calloc (1, sizeof (sslsockdata));  conn->sockdata = data;  SSL_library_init();  data->ctx = SSL_CTX_new (SSLv23_client_method ());  /* disable SSL protocols as needed */  if (!option(OPTTLSV1))   {    SSL_CTX_set_options(data->ctx, SSL_OP_NO_TLSv1);  }  if (!option(OPTSSLV2))   {    SSL_CTX_set_options(data->ctx, SSL_OP_NO_SSLv2);  }  if (!option(OPTSSLV3))   {    SSL_CTX_set_options(data->ctx, SSL_OP_NO_SSLv3);  }  data->ssl = SSL_new (data->ctx);  SSL_set_fd (data->ssl, conn->fd);  if ((err = SSL_connect (data->ssl)) < 0)  {    ssl_socket_close (conn);    return -1;  }  data->cert = SSL_get_peer_certificate (data->ssl);  if (!data->cert)  {    mutt_error (_("Unable to get certificate from peer"));    sleep (1);    return -1;  }  if (!ssl_check_certificate (data))  {    ssl_socket_close (conn);    return -1;  }  mutt_message (_("SSL connection using %s"), SSL_get_cipher (data->ssl));  sleep (1);  return 0;}