Docker Community Forums

Share and learn in the Docker community.

"tls: handshake failure" behind proxy

Trying to run Docker on Ubuntu behind proxy:

$ dpkg-query -W docker-ce
docker-ce	5:19.03.2~3-0~ubuntu-bionic

Our proxy uses SSL certificates, which I dropped under /usr/local/share/ca-certificates and executed update-ca-certificates.

In systemd, docker.service is configured to export proxy variables to the environment:

$ cat /etc/systemd/system/docker.service.d/http-proxy.conf 
[Service]
Environment="HTTP_PROXY=http://10.1.2.3:80"
$ cat /etc/systemd/system/docker.service.d/https-proxy.conf 
[Service]
Environment="HTTPS_PROXY=http://10.1.2.3:80"

While other applications that access the Internet through the proxy function properly, I am having trouble with Docker:

$ docker search osticket
Error response from daemon: Get https://index.docker.io/v1/search?q=osticket&n=25: remote error: tls: handshake failure

I suspect this has to do with the certificates, because the above command executes properly if I temporarily switch to a proxy that does not use certificates.

Any pointers would be appreciated.

Thanks in advance!

I realize this is mis-tagged as ‘swarm’ and don’t have permission to change it.

I would also like to note that doing a GET on the command line for the URL reported in the error works and returns proper JSON:

$ GET 'https://index.docker.io/v1/search?q=osticket&n=25'

I wonder why it does not work within the daemon.

I searched the forum for similar topics but was not able to find a suggestion that would solve my problem in the replies.