Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #5593

Closed (moved)
(moved)
Open
Created Apr 10, 2012 by Trac@tracbot

HttpsProxy sometimes ought to set Host: header

Hello,

I'm in an organization using Apache as a Proxy to provide Internet Access.

I noticed that Tor isn't properly working, in fact the Proxy always replies with "400 Bad Request" errors.

Here is my configuration file:

ControlPort 9051
DirReqStatistics 0
HTTPSProxy 10.0.51.254:80
HTTPSProxyAuthenticator xxxxxx:xxxxxx
Socks5ProxyUsername xxxxxx
Socks5ProxyPassword xxxxxx
Log notice stdout
ReachableAddresses *:80,*:443
ReachableAddresses reject *:*
SocksListenAddress 127.0.0.1

I noticed that Tor does a CONNECT HTTP/1.1 and then sends the authentication information. This results in the 400 Bad Request error, because when using HTTP/1.1 you should provide a Host: header afaik.

Here is a dump of the issue :

CONNECT 86.59.21.38:443 HTTP/1.1
Proxy-Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxx

HTTP/1.1 400 Bad Request
Date: Tue, 10 Apr 2012 11:06:33 GMT
Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8d DAV/2

And here is a "working" CONNECT using Putty (for example) :

CONNECT 88.191.119.38:443 HTTP/1.1
Host: 88.191.119.38:443
Proxy-Authorization: Basic xxxxxxxxxxxxxxxx
HTTP/1.0 200 Connection Established
Proxy-agent: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8d DAV/2SSH-2.0-OpenSSH_5.8p1 Debian-1ubuntu3

I checked the GIT repository to find the issue, my guess is that it's around line 1487 in src/or/connection.c (https://gitweb.torproject.org/tor.git/blob?f=src/or/connection.c#l1487), but my C skills are rather limited...

Trac:
Username: munsternet

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking