Skip to content

[VSCode] Vscode does not connect to self-signed gitlab

Problem

It looks like VSCode does not respect  "gitlab.ignoreCertificateErrors": true on Windows.

Here's the error message I got when trying to connect to a gitlab instance that is signed with a self-signed certificate.

2025-04-17T18:30:19:418 [error]: {
      "userMessage": "Request failed: Can't add GitLab account for https://gdk.test:8080. Check your instance URL and network connection.",
      "errorMessage": "request to https://gdk.test:8080/api/v4/personal_access_tokens/self failed, reason: unable to verify the first certificate",
      "stack": [
        "FetchError: request to https://gdk.test:8080/api/v4/personal_access_tokens/self failed, reason: unable to verify the first certificate",
        "    at ClientRequest.<anonymous> (/home/azubov/.vscode-server/extensions/node_modules/node-fetch/lib/index.js:1501:11)",
        "    at ClientRequest.emit (node:events:530:35)",
        "    at emitErrorEvent (node:_http_client:101:11)",
        "    at TLSSocket.socketErrorListener (node:_http_client:504:5)",
        "    at TLSSocket.emit (node:events:518:28)",
        "    at emitErrorNT (node:internal/streams/destroy:169:8)",
        "    at emitErrorCloseNT (node:internal/streams/destroy:128:3)",
        "    at processTicksAndRejections (node:internal/process/task_queues:82:21)"
      ]
    }

Solution

Unclear now, further investigation is needed to localise the problem:

First, we need to verify, that the current solution with ignoring certificates works outside of the GitLab Workflow extension:

  1. Verify that node.js fetch is able to connect to the server in this setup
  2. If that works, verify, that the direct call from vscode extension with hard-coded ignoring certificates works.
  3. if that works: verify that the options are properly passed to the gitlab LS.

Once the problem is localised in one of the above steps, this issue will be updated with more details.

Additional context

This is a follow-up of this customer issue. They have a slightly different error, but the OS matches the problem