Using an HTTP Proxy

Some network environments may only allow external Internet access or access to content servers by going through an HTTP proxy.

Configuring an HTTP Proxy for GUI Use

The CentOS Subscription Manager GUI can be configured to use an HTTP proxy for all of its connections to the subscription service. (This is also an advanced configuration option at firstboot.) To configure the proxy:

  1. Launch the CentOS Subscription Manager GUI. For example:
subscription-manager-gui

Configuring HTTP Proxy in the rhsm.conf File

The HTTP proxy settings can be configured in the rhsm.conf file; this is the same as configuring it in the Subscription Manager GUI. The proxy configuration is stored and used for every connection between the subscription service and the local system.

  1. Open the Subscription Manager configuration file.
vim /etc/rhsm/rhsm.conf
[server]
# an http proxy server to use
proxy_hostname = proxy.example.com
# port for http proxy server
proxy_port = 443
# user name for authenticating to an http proxy, if needed
proxy_user =
# password for basic http proxy auth, if needed
proxy_password =

Passing HTTP Proxy Information with subscription-manager Commands

Rather than using a permanently-configured HTTP proxy, as the GUI does, HTTP proxy information can be passed with a command invocations. The arguments listed in are available to every command used with subscription-manager.

Table 14.8. Proxy Arguments

Argument Description Required for a Proxy Connection?
--proxy Gives the proxy server to connect to, in the format hostname:port. Yes
--proxyuser Gives the username to use to authenticate. This is only required if user authentication is required. No
--proxypass Gives the password to use with the user account. This is only required if user authentication is required. No

The proxy information can be passed with any subscription-manager operation. For example:

[root@server1 ~]# subscription-manager subscribe --pool=ff8080812bc382e3012bc3845ca000cb --proxy=proxy.example.com:8443 --proxyuser=jsmith --proxypass=secret