diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-06-26 11:18:38 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-07-02 10:14:48 -0400 |
commit | 7b5f58a1c93f99ef3eaa840b4443ca0a4120a512 (patch) | |
tree | 91c7fbdc389bb5972093a96d62d80bcfb5fc55d5 /src/core | |
parent | e429ceb2667787750af070929d0e64cbc7a6dda4 (diff) | |
download | tor-7b5f58a1c93f99ef3eaa840b4443ca0a4120a512.tar.gz tor-7b5f58a1c93f99ef3eaa840b4443ca0a4120a512.zip |
Carry TLS error strings forward to controller when reporting them.
Now instead of saying "DONE, DONE" or "MISC, MISC" or "TLS_ERROR,
TLS_ERROR", we can finally give a nice sensible "TLS_ERROR,
wrong version number" which should help debug a great deal.
Closes ticket 32622.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/or/connection_or.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/core/or/connection_or.c b/src/core/or/connection_or.c index 4cb83f45a9..b88d1b6afb 100644 --- a/src/core/or/connection_or.c +++ b/src/core/or/connection_or.c @@ -745,10 +745,16 @@ connection_or_about_to_close(or_connection_t *or_conn) int reason = tls_error_to_orconn_end_reason(or_conn->tls_error); connection_or_event_status(or_conn, OR_CONN_EVENT_FAILED, reason); - if (!authdir_mode_tests_reachability(options)) - control_event_bootstrap_prob_or( - orconn_end_reason_to_control_string(reason), - reason, or_conn); + if (!authdir_mode_tests_reachability(options)) { + const char *warning = NULL; + if (reason == END_OR_CONN_REASON_TLS_ERROR && or_conn->tls) { + warning = tor_tls_get_last_error_msg(or_conn->tls); + } + if (warning == NULL) { + warning = orconn_end_reason_to_control_string(reason); + } + control_event_bootstrap_prob_or(warning, reason, or_conn); + } } } } else if (conn->hold_open_until_flushed) { |