How can I resolve "server gave HTTP response to HTTPS client"

I have three server:
1 master:
1 node:
1 rancher:
I have create docker image (private registry docker) on node used
Both master and node pushed and pulled to image. But used rancher deploy set image then error:
Failed to pull image “”: rpc error: code = Unknown desc = failed to pull and unpack image “”: failed to resolve reference “”: failed to do request: Head “”: http: server gave HTTP response to HTTPS client.

My image used
http not https. But rancher send https.

How can I resolve “server gave HTTP response to HTTPS client”

HTTPS Client Authentication is a more secure method of authentication than either basic or form-based authentication . It uses HTTP over SSL (HTTPS), in which the server authenticates the client using the client’s Public Key Certificate (PKC).

Hopefully this will help anyone having issues getting the insecure-registries fix to work.
Try below code.


{ "insecure-registries":["host:port"] }



did not work for me until I created the file


and put the line


in it and then restarted the docker daemon with

sudo systemctl stop docker and sudo systemctl start docker.

For some reason just doing a sudo systemctl restart docker did not work. It threw an error about trying to restart the service to quickly.

Also for ["host:port"] I used the IP of my Docker registry as opposed to the hostname as I did not have DNS or a hosts file setup to be able to find the registry by hostname.

This drove me absolutely nuts until I stumbled upon the /etc/default/docker bit here
I am new to Docker and so I don’t know if this is new requirement since this initial post was answered or if there was something else I missed when I first setup my registry. Though all I did was to follow the current docs on the Docker site itself.