Cannot add rancher agent to rancher ssl server

I have followed the setup instructions for SSL and have a rancher server available (can setup authentication, etc).

I went to add a rancher agent to the same box as the rancher-server using the following command:

sudo docker run -e CATTLE_HOST_LABELS='master=true' -d --privileged -v /var/run/docker.sock:/var/run/docker.sock --name=rancher-agent rancher/agent:v0.7.9 http://localhost:8080/v1/scripts/#{REDACTED_TOKEN}

The agent starts up fine and produces:

INFO: docker info: No Proxy:
INFO: Attempting to connect to:
INFO: is accessible
INFO: Inspecting host capabilities
INFO: System: true
INFO: Host writable: true
INFO: Token: xxxxxxxx
INFO: Running registration
Traceback (most recent call last):
File “./”, line 11, in
File “/usr/local/lib/python2.7/dist-packages/”, line 34, in from_env
return gdapi.from_env(prefix=prefix, factory=Client, **kw)
File “/usr/local/lib/python2.7/dist-packages/”, line 604, in from_env
return _from_env(prefix=prefix, factory=factory, **args)
File “/usr/local/lib/python2.7/dist-packages/”, line 623, in _from_env
return factory(**result)
File “/usr/local/lib/python2.7/dist-packages/”, line 12, in init
super(Client, self).init(*args, **kw)
File “/usr/local/lib/python2.7/dist-packages/”, line 195, in init
File “/usr/local/lib/python2.7/dist-packages/”, line 309, in _load_schemas
response = self._get_response(self._url)
File “/usr/local/lib/python2.7/dist-packages/”, line 258, in _get_response
File “/usr/local/lib/python2.7/dist-packages/requests/”, line 477, in get
return self.request(‘GET’, url, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/requests/”, line 465, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python2.7/dist-packages/requests/”, line 573, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/requests/”, line 415, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: (‘Connection aborted.’, error(110, ‘Connection timed out’))

The error takes a long time to show up. When I look at the server logs I see this block repeating and repeating:

time=“2015-07-09T02:13:14Z” level=info msg="Exiting go-machine-service…"
time=“2015-07-09T02:13:16Z” level=info msg=“Setting log level” logLevel=info
time=“2015-07-09T02:13:16Z” level=info msg=“Starting go-machine-service…” gitcommit="9320efc"
time=“2015-07-09T02:13:46Z” level=error msg=“Unable to create EventRouter” Err=“Get http://#{redacted_external_host_name}/v1: dial tcp #{redacted_external_ip}:80: i/o timeout”

Adding the same host that is running rancher/server requires an extra environment variable…

Thank you! was able to figure this one out.