aboutsummaryrefslogtreecommitdiff
path: root/src/common/tortls.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2011-08-11 20:37:51 +0200
committerSebastian Hahn <sebastian@torproject.org>2011-08-11 20:37:51 +0200
commitf137ae896ef2741079ac698e8cabf229b9f4cde8 (patch)
treefd8534b259e1e130c10e219c268abc3c040360be /src/common/tortls.c
parentcd44145c5b1f8f49f6ddd2c9a2d5aaa5c6ef85db (diff)
downloadtor-f137ae896ef2741079ac698e8cabf229b9f4cde8.tar
tor-f137ae896ef2741079ac698e8cabf229b9f4cde8.tar.gz
Don't warn on http connection to my orport
Also remove a few other related warnings that could occur during the ssl handshake. We do this because the relay operator can't do anything about them, and they aren't their fault.
Diffstat (limited to 'src/common/tortls.c')
-rw-r--r--src/common/tortls.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 21f2c5072..455603030 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -273,6 +273,22 @@ tor_tls_log_one_error(tor_tls_t *tls, unsigned long err,
addr = tls ? tls->address : NULL;
+ /* Some errors are known-benign, meaning they are the fault of the other
+ * side of the connection. The caller doesn't know this, so override the
+ * priority for those cases. */
+ switch (ERR_GET_REASON(err)) {
+ case SSL_R_HTTP_REQUEST:
+ case SSL_R_HTTPS_PROXY_REQUEST:
+ case SSL_R_RECORD_LENGTH_MISMATCH:
+ case SSL_R_RECORD_TOO_LARGE:
+ case SSL_R_UNKNOWN_PROTOCOL:
+ case SSL_R_UNSUPPORTED_PROTOCOL:
+ severity = LOG_INFO;
+ break;
+ default:
+ break;
+ }
+
msg = (const char*)ERR_reason_error_string(err);
lib = (const char*)ERR_lib_error_string(err);
func = (const char*)ERR_func_error_string(err);