summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-10-03 08:18:08 -0400
committerNick Mathewson <nickm@torproject.org>2017-10-03 08:18:08 -0400
commita6c62cbd13750bf12d72a07e9552ea0e8de0b2b7 (patch)
tree3644a90ab3ad4645592a3f98c1d3c8969456bd32
parentf2e820c45ff298eee56478ebb0921aecc55cc39a (diff)
parentf923aeee1b14c2f64a657049ba46e68d70f53a0f (diff)
downloadtor-a6c62cbd13750bf12d72a07e9552ea0e8de0b2b7.tar.gz
tor-a6c62cbd13750bf12d72a07e9552ea0e8de0b2b7.zip
Merge branch 'bug23678_032'
-rw-r--r--changes/bug236787
-rw-r--r--src/or/proto_socks.c19
-rw-r--r--src/test/test_socks.c2
3 files changed, 18 insertions, 10 deletions
diff --git a/changes/bug23678 b/changes/bug23678
new file mode 100644
index 0000000000..8138ea71ea
--- /dev/null
+++ b/changes/bug23678
@@ -0,0 +1,7 @@
+ o Minor bugfixes (warnings):
+ - When we get an HTTP request on a SOCKS port, tell the user about
+ the new HTTPTunnelPort option. Previously, we would give a
+ "Tor is not an HTTP Proxy" message, which stopped being true when
+ HTTPTunnelPort was introduced. Fixes bug 23678; bugfix on
+ 0.3.2.1-alpha.
+
diff --git a/src/or/proto_socks.c b/src/or/proto_socks.c
index 4189c0c662..7649fcc4be 100644
--- a/src/or/proto_socks.c
+++ b/src/or/proto_socks.c
@@ -160,23 +160,23 @@ static const char SOCKS_PROXY_IS_NOT_AN_HTTP_PROXY_MSG[] =
"Content-Type: text/html; charset=iso-8859-1\r\n\r\n"
"<html>\n"
"<head>\n"
- "<title>Tor is not an HTTP Proxy</title>\n"
+ "<title>This is a SOCKS Proxy, Not An HTTP Proxy</title>\n"
"</head>\n"
"<body>\n"
- "<h1>Tor is not an HTTP Proxy</h1>\n"
+ "<h1>This is a SOCKs proxy, not an HTTP proxy.</h1>\n"
"<p>\n"
- "It appears you have configured your web browser to use Tor as "
- "an HTTP proxy.\n\n"
- "This is not correct: Tor is a SOCKS proxy, not an HTTP proxy.\n"
+ "It appears you have configured your web browser to use this Tor port as\n"
+ "an HTTP proxy.\n"
+ "</p><p>\n"
+ "This is not correct: This port is configured as a SOCKS proxy, not\n"
+ "an HTTP proxy. If you need an HTTP proxy tunnel, use the HTTPTunnelPort\n"
+ "configuration option in place of, or in addition to, SOCKSPort.\n"
"Please configure your client accordingly.\n"
"</p>\n"
"<p>\n"
"See <a href=\"https://www.torproject.org/documentation.html\">"
"https://www.torproject.org/documentation.html</a> for more "
"information.\n"
- "<!-- Plus this comment, to make the body response more than 512 bytes, so "
- " IE will be willing to display it. Comment comment comment comment "
- " comment comment comment comment comment comment comment comment.-->\n"
"</p>\n"
"</body>\n"
"</html>\n";
@@ -544,7 +544,8 @@ parse_socks(const char *data, size_t datalen, socks_request_t *req,
/* fall through */
default: /* version is not socks4 or socks5 */
log_warn(LD_APP,
- "Socks version %d not recognized. (Tor is not an http proxy.)",
+ "Socks version %d not recognized. (This port is not an "
+ "HTTP proxy; did you want to use HTTPTunnelPort?)",
*(data));
{
/* Tell the controller the first 8 bytes. */
diff --git a/src/test/test_socks.c b/src/test/test_socks.c
index 1568453685..9ae7530e22 100644
--- a/src/test/test_socks.c
+++ b/src/test/test_socks.c
@@ -763,7 +763,7 @@ test_socks_wrong_protocol(void *ptr)
tt_int_op(fetch_from_buf_socks(buf, socks, 1, 0), OP_EQ, -1);
buf_clear(buf);
expect_log_msg_containing("Socks version 71 not recognized. "
- "(Tor is not an http proxy.)");
+ "(This port is not an HTTP proxy;");
mock_clean_saved_logs();
socks_request_clear(socks);