Skip to content

Feature Request: Add flexible SSL certificate verification options in configuration #3685

@sagico

Description

@sagico

Description
Currently, gitbeaker only supports handling unverified certificates through environment variables (NODE_TLS_REJECT_UNAUTHORIZED=0), which is limiting and affects the entire Node.js process. This feature request proposes adding more flexible certificate verification options directly in the API client configuration.
The main use cases are:

Working with GitLab instances that use self-signed certificates in development/testing environments
Environments where corporate proxies or internal CAs are used

The current environment variable approach has several drawbacks:

It affects all HTTPS connections in the Node.js process
Cannot be configured per-instance or per-request
Requires modifying environment variables which may not be possible in all deployment scenarios

Possible solutions

  1. Support the rejectUnauthorized option to the API client configuration:
    const api = new Gitlab({ host: 'https://gitlab.example.com', token: 'your-token', rejectUnauthorized: false // Available option that does not work currently });
  2. Add support for passing custom certificates in the configuration:
    const api = new Gitlab({ host: 'https://gitlab.example.com', token: 'your-token', cert: fs.readFileSync('path/to/cert.pem'), key: fs.readFileSync('path/to/key.pem'), ca: fs.readFileSync('path/to/ca.pem') });

Checklist

  • I have checked that this is not a duplicate issue.
  • I have read the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureChanges add a new feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions