Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitea authentication with custom certificate authority #32746

Open
CrashSensei opened this issue Dec 6, 2024 · 0 comments
Open

Gitea authentication with custom certificate authority #32746

CrashSensei opened this issue Dec 6, 2024 · 0 comments
Labels

Comments

@CrashSensei
Copy link

Description

Problem

The Gitea authentication process does not correctly use the operating system certificate authority collection.

I have a custom CA and mounted my full certificate authority chain to /etc/ssl/certs/ca-certificates.crt.
However, when I attempted to setup OAuth2 I received the error:

Caution

tls: failed to verify certificate: x509: certificate signed by unknown authority

I verified that the container OS ca-certs were working correctly by using curl inside the container:

podman exec -it --user git gitea-app curl https://keycloak.fake.com/realms/main/.well-known/openid-configuration

I found a previous issue referencing this same problem:
#29420 (comment)

Referencing their workaround, I mounted my root and sub ca certs separately under the /etc/ssl/certs directory.
Gitea now correctly verified the custom certificate. However, the container OS no longer recognized the custom ca (curl fails).

I have verified that the same issue exists for LDAP authentication.

Solution

Gitea should use the standard OS CA collection instead of scanning the CA directory. For Alpine Linux that is /etc/ssl/ca-certificates.crt or /etc/ssl/cert.pem (a symlink to the former).

Gitea Version

1.22.4

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Docker container docker.io/gitea/gitea:1.22.3

How are you running Gitea?

Launching docker container via systemd using podman

Database

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant