git-cliff icon indicating copy to clipboard operation
git-cliff copied to clipboard

Allow to use self-hosted gitlab instances with own CA cert chain

Open bjoernricks opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description of the bug

Hi,

currently it's not possible to use git-cliff with a self-hosted GitLab instance that uses an own CA for example with self-signed certificates.

A possible solution would be to use the rustls-tls-native-roots feature instead of rustls-tls for reqwest or provide a similar CLI argument like uv in https://github.com/astral-sh/uv/pull/2362

Steps To Reproduce

  1. Setup a GitLab instance with a self-signed CA
  2. Set GITLAB_REPO, GITLAB_TOKEN and GITLAB_API_URL environment variables
  3. Run git-cliff

Expected behavior

git-cliff can request information from a self-hosted GitLab instance using an own CA cert chain

Screenshots / Logs

 WARN  git_cliff_core::changelog > You are using an experimental feature! Please report bugs at <https://git-cliff.org/issues>
 ERROR git_cliff_core::changelog > Failed to lookup project! HTTP client with middleware error: `Middleware error: Request error: error sending request for url (https://xxx/api/v4/projects/xxx)`
thread 'main' panicked at git-cliff-core/src/changelog.rs:452:18:
Could not get gitlab metadata: HttpClientMiddlewareError(Middleware(Request error: error sending request for url (https://xxx/api/v4/projects/xxx)
Caused by:
    0: error sending request for url (https://xxx/api/v4/projects/xxx)
    1: client error (Connect)
    2: invalid peer certificate: UnknownIssuer

Software information

  • Operating system: Debian Linux
  • Project version: 2.5.0 installed from PyPI

Additional context

No response

bjoernricks avatar Sep 19 '24 11:09 bjoernricks

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

welcome[bot] avatar Sep 19 '24 11:09 welcome[bot]

Hey, thanks for reporting!

The possible solution you recommended looks solid, would you be down to implement it? 🐻 I can also try it out but it would be easier if you already have an environment to test it out.

orhun avatar Sep 21 '24 12:09 orhun

Sorry missed your answer. Sadly I have no experience with rust yet and therefore I don't think I can provide a good PR :-(

bjoernricks avatar Oct 11 '24 06:10 bjoernricks

I am encountering the same issue. Any chance for this to be implemented soon?

bal-stan avatar Jan 16 '25 16:01 bal-stan

Now implemented in #1021, it's going to be the part of the release that I'm planning to push tomorrow.

Testing it would be appreciated!

orhun avatar Jan 23 '25 15:01 orhun