Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] tinyproxy filtering http headers unexpectedly
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
wwdev16
n00b
n00b


Joined: 29 Aug 2018
Posts: 52

PostPosted: Fri Jun 11, 2021 12:32 am    Post subject: [SOLVED] tinyproxy filtering http headers unexpectedly Reply with quote

tinyproxy appears to be filtering non-standard http headers even though I believe
it is configured to not do that. This causes problems with the new version of proton mail.

Not finding anything useful on https://github.com/tinyproxy/tinyproxy/issues or
in man tinyproxy or man tinyproxy.conf.

In /var/log/tinyproxy/tinyproxy.log I see:
Code:
Not sending client headers to remote machine

All of thes commands return nothing:
Code:
grep -v '#' /etc/tinproxy/tinyproxy.conf | grep -i Anon
grep -v '#' /etc/tinproxy/tinyproxy.conf | grep -i Via
grep -v '#' /etc/tinproxy/tinyproxy.conf | grep -i Host
grep -v '#' /etc/tinproxy/tinyproxy.conf | grep -i XTinyproxy


Is there some config directive needed for web clients to have non-standard headers sent?

$ qlist -ICv tinyproxy:
Code:
acct-group/tinyproxy-0                                                                                         
acct-user/tinyproxy-0                                                                                           
net-proxy/tinyproxy-1.11.0_rc1

$ equery u tinyproxy:
Code:
 * Found these USE flags for net-proxy/tinyproxy-1.11.0_rc1:
 U I
 - - debug             : Enable extra debug codepaths, like asserts and extra output. If you want to get
                         meaningful backtraces see
                         https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
 + + filter-proxy      : Enable filtering of domains/URLS
 - - reverse-proxy     : Enable reverse proxying
 - - test              : Enable dependencies and/or preparations necessary to run tests (usually controlled by
                         FEATURES=test but can be toggled independently)
 - - transparent-proxy : Enable transparent proxying
 - - upstream-proxy    : Enable upstream proxying
 - - xtinyproxy-header : Include the X-Tinyproxy header


Last edited by wwdev16 on Sat Jun 12, 2021 4:47 am; edited 1 time in total
Back to top
View user's profile Send private message
user
Apprentice
Apprentice


Joined: 08 Feb 2004
Posts: 201

PostPosted: Fri Jun 11, 2021 8:08 am    Post subject: Reply with quote

A wonderful world of open source.

Code:
# ebuild /var/db/repos/gentoo/net-proxy/tinyproxy/tinyproxy-1.11.0.ebuild prepare

# grep -r "Not sending client headers to remote machine" /tmp/portage/net-proxy/tinyproxy-1.11.0/work/tinyproxy-1.11.0/
/tmp/portage/net-proxy/tinyproxy-1.11.0/work/tinyproxy-1.11.0/src/reqs.c:                             "Not sending client headers to remote machine");

# grep -B8 "Not sending client headers to remote machine" /tmp/portage/net-proxy/tinyproxy-1.11.0/work/tinyproxy-1.11.0/src/reqs.c
        /*
         * Don't send headers if there's already an error, if the request was
         * a stats request, or if this was a CONNECT method (unless upstream
         * http proxy is in use.)
         */
        if (connptr->server_fd == -1 || connptr->show_stats
            || (connptr->connect_method && ! UPSTREAM_IS_HTTP(connptr))) {
                log_message (LOG_INFO,
                             "Not sending client headers to remote machine");


Ready to verify possible reasons?
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3131

PostPosted: Fri Jun 11, 2021 9:43 pm    Post subject: Reply with quote

Quote:
Is there some config directive needed for web clients to have non-standard headers sent?

It does allow you to control what headers will be passed to the server.
AFAIR anonymous mode strips all non-essential headers.

But.... if I were you, I'd start with starting tcpdump on the machine with your proxy. And trying to connect anywhere. Possibly over HTTP, so I could easily eavesdrop on that conversation, and perhaps see how it fails.
Back to top
View user's profile Send private message
wwdev16
n00b
n00b


Joined: 29 Aug 2018
Posts: 52

PostPosted: Sat Jun 12, 2021 4:45 am    Post subject: [SOLVED] tinyproxy filtering http headers unexpectedly Reply with quote

I'm going to call it a bug. Using privoxy instead doesn't have the problem.

From what I know of the HTTP spec, the CONNECT method doesn't require
stripping http headers from the initial connection to the destination. So I
suspect tinyproxy's behavior as shown by user's code snippet isn't correct.

Thanks for the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum