Skip to content

[BUG] Unable to connect to self-hosted gitlab over https when internal CA is used #64

@abpetrov

Description

@abpetrov

📋 Checklist

  • I’m running the latest main or a recent release.
  • I’ve searched existing issues and no open issue covers this bug.
  • If this is a build problem, I attached the full error log.

What version?

kingfisher --version 1.28.0

🐞 What happened?

I am trying to connect to a self-hosted gitlab instance which uses a certificate from an internal CA and kingfisher fails with UnknownIssuer. The internal CA is trusted by the OS.

✅ What did you expect to happen?

Connection to self-hosted gitlab via https with internal CA should succeed.

🔢 Reproduction steps

I tried the following:

  1. Run kingfisher directly
kingfisher gitlab repos list --gitlab-api-url="https://server.local/"
 INFO kingfisher::update: Checking for updates…
 WARN kingfisher::update: Failed to check for updates
Error: api error: client error: communication with gitlab: error sending request for url (https://server.local/api/v4/user?)

Caused by:
    0: client error: communication with gitlab: error sending request for url (https://server.local/api/v4/user?)
    1: communication with gitlab: error sending request for url (https://server.local/api/v4/user?)
    2: error sending request for url (https://server.local/api/v4/user?)
    3: client error (Connect)
    4: invalid peer certificate: UnknownIssuer
  1. Specify environment variable with the CA bundle.
SSL_CERT_FILE="/etc/pki/tls/certs/ca-bundle.crt" ./kingfisher gitlab repos list --gitlab-api-url="https://server.local/"
 INFO kingfisher::update: Checking for updates…
 WARN kingfisher::update: Failed to check for updates
Error: api error: client error: communication with gitlab: error sending request for url (https://server.local/api/v4/user?)

Caused by:
    0: client error: communication with gitlab: error sending request for url (https://server.local/api/v4/user?)
    1: communication with gitlab: error sending request for url (https://server.local/api/v4/user?)
    2: error sending request for url (https://server.local/api/v4/user?)
    3: client error (Connect)
    4: invalid peer certificate: UnknownIssuer

💻 Environment

Item Value
OS / Distro Red Hat Enterprise Linux release 9.6
kingfisher ver. 1.28.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions