The methods for setting a proxy have different effects and advantages. For example, the pkg set-publisher command stores the proxy as part of the publisher configuration, while the http_proxy environment variables enable you to set authenticated proxies.
The --proxy option of the pkg set-publisher command sets a persistent proxy URI for the specified publisher origin and mirror URIs. The proxy value is stored as part of the publisher configuration. Storing the proxy value as part of the publisher configuration automatically updates the system repository that is used by child images. Storing the proxy value as part of the publisher configuration also means you could use different proxies for different publishers.
$ pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F file:///export/IPSpkgrepos/Solaris/ $ pkg publisher -F tsv PUBLISHER STICKY SYSPUB ENABLED TYPE STATUS URI PROXY solaris true false true origin online file:///export/IPSpkgrepos/Solaris/ - $ pkg set-publisher -g http://pkg.oracle.com/solaris/release/ --proxy proxyURI solaris $ pkg publisher solaris Publisher: solaris Alias: Origin URI: file:///export/IPSpkgrepos/Solaris/ SSL Key: None SSL Cert: None Origin URI: http://pkg.oracle.com/solaris/release/ Proxy: proxyURI SSL Key: None SSL Cert: None Client UUID: e15e3228-eada-11df-80ab-8023183d954b Catalog Updated: July 11, 2013 11:32:46 PM Enabled: Yes Properties: proxied-urls =  $ pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F file:///export/IPSpkgrepos/Solaris/ solaris origin online T http://pkg.oracle.com/solaris/release/ $ pkg publisher -F tsv PUBLISHER STICKY SYSPUB ENABLED TYPE STATUS URI PROXY solaris true false true origin online file:///export/IPSpkgrepos/Solaris/ - solaris true false true origin online http://pkg.oracle.com/solaris/release/ proxyURI
If this image has non-global zones, the system repository is automatically updated with this proxy information; you do not need to set properties in the system-repository service. If you examine the publisher proxy in the non-global zone, you do not see the same proxy URI that you see in the global zone. In the global zone, the system repository uses the proxy URI. In the non-global zone, the system repository acts as a proxy itself, enabling the non-global zone to communicate with the system repository in the global zone. Relationship Between Global and Non-Global Zones shows an example of what the system repository publisher looks like in the non-global zone.
The --proxy option of the pkg set-publisher command cannot be used to set an authenticated proxy. The value of the --proxy option cannot have the form protocol://user:password@host.
Proxy environment variable values apply to all URIs of that protocol. At runtime, values of http_proxy environment variables override values set with the --proxy option of the pkg set-publisher command. See the ENVIRONMENT section of the curl(1) man page for additional information about proxy environment variables.
If you set http_proxy environment variables in an image that has non-global zones, then in the global zone, set the proxy properties in the svc:/application/pkg/system-repository SMF service to these same values and refresh the service.
$ svccfg -s system-repository:default setprop config/http_proxy = astring: proxyURI $ svccfg -s system-repository:default listprop config/*proxy config/https_proxy astring config/http_proxy astring proxyURI $ svcprop system-repository:default | grep proxy config/https_proxy astring "" config/http_proxy astring "" $ svcadm refresh system-repository:default $ svcprop system-repository:default | grep proxy config/https_proxy astring "" config/http_proxy astring proxyURI
The pkg publisher command does not show proxies that were set by setting environment variables or SMF service properties.
If you change the value of an http_proxy environment variable, be sure to update the system-repository service properties and refresh the service.