Commit d486c6cf authored by Nick Mathewson's avatar Nick Mathewson 🤹
Browse files

Store errors from TLS write and handshake in the tls_error field.

Previously, we would only update this field when the error happened
during a read.

This will improves our reporting for our bootstrap status, and help
to address #32622.  The problem is not completely solved by this
patch, however: too many errors are still lumped into "MISC".
parent 68d848e2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4205,6 +4205,7 @@ connection_handle_write_impl(connection_t *conn, int force)
    switch (result) {
      CASE_TOR_TLS_ERROR_ANY:
      case TOR_TLS_CLOSE:
        or_conn->tls_error = result;
        log_info(LD_NET, result != TOR_TLS_CLOSE ?
                 "tls error. breaking.":"TLS connection closed on flush");
        /* Don't flush; connection is dead. */
+3 −1
Original line number Diff line number Diff line
@@ -1692,6 +1692,7 @@ connection_tls_continue_handshake(or_connection_t *conn)

  switch (result) {
    CASE_TOR_TLS_ERROR_ANY:
      conn->tls_error = result;
      log_info(LD_OR,"tls error [%s]. breaking connection.",
             tor_tls_err_to_string(result));
      return -1;
@@ -1724,6 +1725,7 @@ connection_tls_continue_handshake(or_connection_t *conn)
      log_debug(LD_OR,"wanted read");
      return 0;
    case TOR_TLS_CLOSE:
      conn->tls_error = result;
      log_info(LD_OR,"tls closed. breaking connection.");
      return -1;
  }