Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
sagico opened this issue Feb 16, 2025 · 0 comments
Open
2 tasks done

Comments

@sagico
Copy link

sagico commented Feb 16, 2025

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant