singularity icon indicating copy to clipboard operation
singularity copied to clipboard

Cannot pull harbor insecure registry images,Error x509: certificate relies on legacy Common Name field

Open qzwlinux opened this issue 5 years ago • 5 comments

Version of Singularity:

What version of Singularity are you using? Run:

$ singularity version

3.6.2

Expected behavior

What did you expect to see when you do...?

singularity can pull insecure docker registry image use HarborRegistry

Actual behavior

What actually happend? Why was it incorrect?

$ singularity pull docker://ngc.em.io/nvidia/nvidia_rn50_mx:latest      
                                                                                                                                                              
FATAL:   While making image from oci registry: error fetching image to cache: failed to get checksum for docker://ngc.em.io/nvidia/nvidia_rn50_mx:latest: error pinging docker registry ngc.em.io: Get "https://ngc.em.io/v2/": x509: certificate relies on legacy Common Name field, use SANs or temporarily enable Common Name matching with GODEBUG=x509ignoreCN=0

Steps to reproduce this behavior

How can others reproduce this issue/problem?

What OS/distro are you running

$ cat /etc/os-release

NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"


How did you install Singularity

Write here how you installed Singularity. Eg. RPM, source.

source

qzwlinux avatar Dec 29 '20 02:12 qzwlinux

As the error messages suggests, you will need to:

export GODEBUG=x509ignoreCN=0

... until the site's certificate is updated to use SANs. This is not an issue with Singularity and Harbor, but with the certificate in use for ngc.em.io. Singularity is written in Go, and Go is deprecating support for certificate CN matching:

https://golang.org/pkg/crypto/x509/#Certificate.VerifyHostname

The legacy Common Name field is ignored unless it's a valid hostname, the certificate doesn't have any Subject Alternative Names, and the GODEBUG environment variable is set to "x509ignoreCN=0". Support for Common Name is deprecated will be entirely removed in the future.

dtrudg avatar Dec 29 '20 15:12 dtrudg

Hi Everyone. I have the same issue after installing Harbor. I have set the https. When trying to connect to docker I have the following error.

docker login https://<HARBOR_IP> Error response from daemon: Get "https://<HARBOR_IP>/v2/": x509: certificate relies on legacy Common Name field, use SANs or temporarily enable Common Name matching with GODEBUG=x509ignoreCN=0

I have set export GODEBUG=x509ignoreCN=0. But I have the same error

Could someone helps me on that please

louistwiice avatar Jul 01 '22 11:07 louistwiice

Please check what version you have in singularity --version and if it starts with "singularity-ce" make a new issue at https://github.com/sylabs/singularity and otherwise make a new issue at https://github.com/apptainer/apptainer, referencing this issue.

DrDaveD avatar Jul 01 '22 14:07 DrDaveD

Hi Everyone. I have the same issue after installing Harbor. I have set the https. When trying to connect to docker I have the following error.

docker login https://<HARBOR_IP> Error response from daemon: Get "https://<HARBOR_IP>/v2/": x509: certificate relies on legacy Common Name field, use SANs or temporarily enable Common Name matching with GODEBUG=x509ignoreCN=0

I have set export GODEBUG=x509ignoreCN=0. But I have the same error

Could someone helps me on that please

+1. The export GODEBUG=x509ignoreCN=0 is not working for me too.

Deepak275 avatar Mar 06 '25 16:03 Deepak275

This repository is closed. If you have an ongoing problem please make a new issue at one of the two URLs listed in my last post above.

DrDaveD avatar Mar 10 '25 17:03 DrDaveD