Docker Login to Gitea Container Registry Fails with TLS Certificate Error (Gitea 1.22.1)

Hi everyone,

I’m encountering a TLS certificate error when trying to log in to the container registry of my self-hosted Gitea instance (version 1.22.1) using Docker.

I’m following the official Gitea documentation for container registries: https://docs.gitea.com/usage/packages/container

Here’s the command I’m using and the error I receive:

(base) erwan2@[REDACTED] CI-CD-Pipeline % docker login http://gitea.[internal-domain].com/
Username: [REDACTED]
Password:
Error response from daemon: Get "https://gitea.[internal-domain].com/v2/": tls: failed to verify certificate: x509: certificate is not valid for any names, but wanted to match gitea.[internal-domain].com
  • My Gitea instance is running on version 1.22.1.
  • [internal-domain] is a placeholder for our internal domain.

Any insights or suggestions would be greatly appreciated!
Thank you!

How did you generate the certificate? I think you forgot to fill in a field for the allowed names.