orhun / git-cliff

A highly customizable Changelog Generator that follows Conventional Commit specifications ⛰️
https://git-cliff.org
Apache License 2.0
9.27k stars 198 forks source link

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

Open bjoernricks opened 1 month ago

bjoernricks commented 1 month ago

Is there an existing issue for this?

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

Additional context

No response

welcome[bot] commented 1 month ago

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

orhun commented 1 month ago

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.

bjoernricks commented 1 month ago

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