Sachith Muhandiram
Sachith Muhandiram

Reputation: 2972

proxyconnect tcp: x509: certificate is valid for Sachith, not myregistry

I had followed given steps here to create "Authenticate proxy with nginx".

Certificates were created using openssh

openssl req  -newkey rsa:4096 -nodes -sha256 -keyout myregistry.key -x509 -days 365 -out myregistry.crt

Then docker-compose up --build bring docker registry starts.

When I try to push image to registry (from same PC running docker-registry):

docker push myregistry:5043/test I get following Error :

Error response from daemon: Get https://myregistry:5043/v2/: proxyconnect tcp: x509: certificate is valid for Sachith, not myregistry

I tried with insecure-registry in daemon.json. But this does not get solved, also solution discussed here is not clear for me.

Also here saying to add certificates to docker config.

Upvotes: 2

Views: 1744

Answers (1)

Sachith Muhandiram
Sachith Muhandiram

Reputation: 2972

I solved this by following

mkdir -p /etc/docker/certs.d/myregistry:5043

cp myregistry.crt /etc/docker/certs.d/myregistry:5000/ca.crt

cp myregistry.crt /usr/local/share/ca-certificates/ca.crt

update-ca-certificates

Upvotes: 1

Related Questions