Found it.

Actually it was due to both a pecularity in the proxy server I wanted to
get through, and a bug in how proxytunnel sets SNI.

It seems that our proxy server ignores SNI in SSLv3, but considers it in
TLSv1.

And proxytunnel sets the wrong SNI.

proxytunnel ---> proxy1 (the one I want to get through)  ---> proxy2 (my
Apache) ---> ssh.

After sending CONNECT proxy2:443 to the proxy1 (in order to be connected
through to proxy2), it starts negotiating the SSL session with proxy2.
It would be logical to base that negotiation on the host name of proxy2.
However, proxytunnel mistakenly includes proxy1 as the SNI in that
negotiation.

With the result that the "evil" proxy1, which snoops at the initial part
of the negotiation (which is still clear-text...), sees that SNI, then
ignores the host that it got in the CONNECT header, and instead attempts
to connect to the host that it saw in the SNI, which would be itself
(proxy1 instead of proxy2).

In my case, just dropping the SNI setting code in stream_enable_ssl in
pstream.c fixed the issue.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to apache2 in Ubuntu.
https://bugs.launchpad.net/bugs/1158141

Title:
  apache2 forward proxy socket read error

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1158141/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to