RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1487472 - Incorrect "Host" header when connecting through a http proxy
Summary: Incorrect "Host" header when connecting through a http proxy
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-rhsm
Version: 6.10
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: 1461138 1506745
TreeView+ depends on / blocked
 
Reported: 2017-09-01 02:49 UTC by Hao Chang Yu
Modified: 2021-09-09 12:34 UTC (History)
7 users (show)

Fixed In Version: subscription-manager-1.21.1-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-19 05:21:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proxy_header (91.24 KB, image/png)
2018-03-16 15:07 UTC, Shwetha Kallesh
no flags Details
server_header (94.22 KB, image/png)
2018-03-16 15:11 UTC, Shwetha Kallesh
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1507158 0 medium CLOSED When connecting through a proxy, subscription-manager does not provide Host: in http CONNECT header 2021-06-10 13:23:33 UTC
Red Hat Product Errata RHBA-2018:1916 0 None None None 2018-06-19 05:22:42 UTC

Internal Links: 1507158

Description Hao Chang Yu 2017-09-01 02:49:59 UTC
Description of problem:
This bug has been fixed and released in RHEL 7 but the same issue is happening in RHEL 6. Please refer to the following RHEL 7 bug for more details.

https://bugzilla.redhat.com/show_bug.cgi?id=1451166

Comment 2 Hao Chang Yu 2017-09-01 02:55:40 UTC
The following patch has been provided to the customer and works.

python-rhsm-1.18.6-1.el6.x86_64

--- /usr/lib64/python2.6/site-packages/rhsm/connection.py	2017-08-11 08:25:22.774000005 +1000
+++ /tmp/connection.py	2017-08-11 08:25:12.128999977 +1000
@@ -479,6 +479,7 @@
                 proxy_headers['Proxy-Authorization'] = _encode_auth(self.proxy_user, self.proxy_password)
             conn = httplib.HTTPSConnection(self.proxy_hostname, self.proxy_port, context=context, timeout=self.timeout)
             conn.set_tunnel(self.host, safe_int(self.ssl_port), proxy_headers)
+            self.headers['Host'] = '%s:%s' % (self.host, safe_int(self.ssl_port))
         else:
             conn = httplib.HTTPSConnection(self.host, self.ssl_port, context=context, timeout=self.timeout)

Comment 3 Kevin Howell 2017-09-07 15:37:04 UTC
Will be fixed in the next RHEL6 release via rebase to upstream.

Comment 7 Shwetha Kallesh 2018-03-16 15:07:32 UTC
Created attachment 1408846 [details]
Proxy_header

Reproducer:

[root@ibm-himalaya ~]# subscription-manager  version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription management rules: Unknown
subscription-manager: 1.18.10-1.el6
python-rhsm: 1.18.6-1.el6

[root@ibm-himalaya ~]# cat /etc/rhsm/rhsm.conf | grep proxy
# an http proxy server to use
proxy_hostname = 10.3.112.29
# port for http proxy server
proxy_port = 8080
# user name for authenticating to an http proxy, if needed
proxy_user =
# password for basic http proxy auth, if needed
proxy_password =

[root@ibm-himalaya ~]# subscription-manager  register
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: shwetha_tier1_test
Password: 
The system has been registered with ID: 7e07bfa8-00bf-4a7c-a838-6a6fbf489fd1 

Attachment has the screenshot captured from mitmproxy , where the HOST is replaced by the proxy name "tyan-gt24-09.rhts.eng.bos.redhat.com" ( proxy_in_header.png)

Comment 8 Shwetha Kallesh 2018-03-16 15:11:08 UTC
Created attachment 1408848 [details]
server_header

Verification:

[root@hp-dl380gen9-01 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription management rules: Unknown
subscription-manager: 1.20.10-3.el6


[root@hp-dl380gen9-01 ~]# subscription-manager register --force
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: shwetha_tier1_test
Password: 
The system has been registered with ID: 1e3686cc-2a34-4f14-a820-83870cb32c75
The registered system name is: hp-dl380gen9-01.khw.lab.eng.bos.redhat.com

Attachment has the screenshotcaptured  from mitmproxy , where the HOST is same as the server which is subscription.rhsm.stage.redhat.com  ( server_header.png)

Comment 11 Shwetha Kallesh 2018-04-24 08:14:18 UTC
moving bug to verified as per comment 8

Comment 14 errata-xmlrpc 2018-06-19 05:21:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:1916


Note You need to log in before you can comment on or make changes to this bug.