Skip to content

fix(network): new API logic supports custom certificates

This MR reintroduces support for custom certificates.

When we started migrating to GraphQL, we also started migrating from now deprecated request-promise npm module.

The request-promise setup in gitlab_service.ts had a bunch of config properties to setup custom certification authority for connecting to GitLab instances that use self-signed certificates.

I originally thought that we can get away with just adding the self-signed certificate into the OS keychain and not have any custom code in the extension. After a lengthy investigation, I could find only one way to connect to a server that uses self-signed certificates: manually supplying the certificates to the node https request.

The request-promise expected the certificates a bit differently than the node-fetch that the current logic uses under the hood. But the code was similar enough that I was able to reuse most of it.

This is extremely hard to test, so the reviewer is only expected to look at the code quality, not to test this locally.

Related to #247 (closed)

Edited by Tomas Vik (OOO back on 2024-08-12)

Merge request reports