Subscription-manager command fails with the error "Tunnel connection failed: 407 authenticationrequired".

Solution Verified - Updated -


  • Red Hat Enterprise Linux 7.x
  • Red Hat Subscription-Manager.
  • Red Hat Customer Portal.


  • While attaching the subscription on the server it fails with the error "Tunnel connection failed: 407 authentication required".


  • Set the proper proxy details in the /etc/rhsm/rhsm.conf file:
proxy_hostname = 
proxy_port = 
proxy_user = 
proxy_password =

Root Cause

  • The proper proxy details were not configured in /etc/rhsm/rhsm.conf file, hence the server was not able to communicate with the proxy server and Red Hat CDN.

Diagnostic Steps

  • Logs from /var/log/rhsm/rhsm.log:
2018-06-26 03:35:42,592 [ERROR] rhsmd:58149:MainThread - Tunnel connection failed: 407 authenticationrequired
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/subscription_manager/", line 170, in update_check
    self._sync_with_server(uep, consumer_uuid)
  File "/usr/lib/python2.7/site-packages/subscription_manager/", line 522, in _sync_with_server
  File "/usr/lib64/python2.7/site-packages/rhsm/", line 1001, in updateConsumer
    ret = self.conn.request_put(method, params)
  File "/usr/lib64/python2.7/site-packages/rhsm/", line 654, in request_put
    return self._request("PUT", method, params, headers=headers)
  File "/usr/lib64/python2.7/site-packages/rhsm/", line 671, in _request
    info=info, headers=headers)
  File "/usr/lib64/python2.7/site-packages/rhsm/", line 527, in _request
    conn.request(request_type, handler, body=body, headers=final_headers)
  File "/usr/lib64/python2.7/", line 1017, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.7/", line 1051, in _send_request
  File "/usr/lib64/python2.7/", line 1013, in endheaders
  File "/usr/lib64/python2.7/", line 864, in _send_output
  File "/usr/lib64/python2.7/", line 826, in send
  File "/usr/lib64/python2.7/", line 1227, in connect
  File "/usr/lib64/python2.7/", line 810, in connect
  File "/usr/lib64/python2.7/", line 792, in _tunnel
error: Tunnel connection failed: 407 authenticationrequired

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.


This is extremely helpful.

So stupid to run into this issue