docker login fails: tls: server selected unsupported protocol version 301

Viewed 4027

I am using docker version 18.09.0, build 4d60db4 in a Windows machine and I am trying to login to Artifactory using the following command,

docker login docker-registery.company.net

It prompts for username and password and I am providing them, however I am not able to login. It gives me the following error:

Error response from daemon: Get https://docker-registery.company.net/v2/: tls: server selected unsupported protocol version 301

Note: I am able to login to the Artifactory Repo Browser through my web browser by using the same username and password.

What is causing this issue when I try to login from the command-line? Is it some kind of proxy or certificate issue?

4 Answers

protocol version 301 = TLS 1.0 - that is insecure TLS version, which has been selected by the server (in theory by Artifactory, but there can be reverse proxy, Tomcat, etc. where TLS can be configured as well).

Configure properly TLS on the server side (enable support for TLS 1.1+) and your docker client will be able to establish a secure TLS connection. "insecure registry" is just insecure workaround.

We have the same issue after some of Windows update

You can manually change the default TLS version in windows by editing register

Change needed values in regedit.exe or store this code as .reg file and execute it.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319]

"SystemDefaultTlsVersions"=dword:00000001



[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319]

"SystemDefaultTlsVersions"=dword:00000001

Hope, it will solve your problem

Try this,

docker login --username=yourUserName --email=abc@company.net dockerregistry.company.net:5000

Obviously, if you are using a port other than 5000 specify it after the colon.

Once you log in, you can do something like

docker push dockerregistry.company.net:5000/ubuntu

or

docker pull dockerregistry.company.net:5000/ubuntu

None of the above answers actually worked for me.

However, I manged to find a fix for it. Keep in mind that, this is not a perfect solution but a work around.

Here it goes...

I added my Artifactory registry as an insecure registry. Here's how to do it: https://docs.docker.com/registry/insecure/

Therefore, by passing the TLS handshake.

Related