[PR #5216] [server] Add an option to disable cert verification for external client requests #25279

Open
opened 2026-08-05 07:05:47 -04:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/netbirdio/netbird/pull/5216

State: closed
Merged: No


Describe your changes

This PR creates a central HTTP client with an option to disable SSL cert validation when making external requests (for example, downloading GeoIP database, check release versions) when NB_DISABLE_CERT_VALIDATION env variable is set to true.

This is useful for self-hosted environments using internal CAs or self-signed certificates which is common when using firewalls that intercepts all the traffic.

Changes:

  1. Created util.NewTransport() and util.NewHTTPClient() to standardize HTTP transport configuration
  2. If NB_DISABLE_CERT_VALIDATION=true, the transport is configured with InsecureSkipVerify: true which will disable certificate validation
  3. If it is set to false which is by default, secure transport is used just like previous versions
  4. The new config is used in GeoIP download logic, OIDC requests, version check and IDP managers

Fixes https://github.com/netbirdio/netbird/issues/5200

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/582

Summary by CodeRabbit

  • Infrastructure Improvements
    • Standardized HTTP client usage across the platform for more consistent and resilient network calls.
    • Added configurable transport behavior (including optional certificate-validation bypass via environment variable) for specialized deployments.
    • Improved HTTP resource handling to ensure responses are properly closed and connections are managed.

✏️ Tip: You can customize this high-level summary in your review settings.

**Original Pull Request:** https://github.com/netbirdio/netbird/pull/5216 **State:** closed **Merged:** No --- ## Describe your changes This PR creates a central HTTP client with an option to disable SSL cert validation when making external requests (for example, downloading GeoIP database, check release versions) when `NB_DISABLE_CERT_VALIDATION` env variable is set to `true`. This is useful for self-hosted environments using internal CAs or self-signed certificates which is common when using firewalls that intercepts all the traffic. Changes: 1. Created `util.NewTransport()` and `util.NewHTTPClient()` to standardize HTTP transport configuration 2. If `NB_DISABLE_CERT_VALIDATION=true`, the transport is configured with `InsecureSkipVerify: true` which will disable certificate validation 3. If it is set to false which is by default, secure transport is used just like previous versions 4. The new config is used in GeoIP download logic, OIDC requests, version check and IDP managers ## Issue ticket number and link Fixes https://github.com/netbirdio/netbird/issues/5200 ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [x] It is a refactor - [ ] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [x] I added/updated documentation for this change - [ ] Documentation is **not needed** for this change (explain why) ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/582 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Infrastructure Improvements** * Standardized HTTP client usage across the platform for more consistent and resilient network calls. * Added configurable transport behavior (including optional certificate-validation bypass via environment variable) for specialized deployments. * Improved HTTP resource handling to ensure responses are properly closed and connections are managed. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
saavagebueno added the pull-request label 2026-08-05 07:05:47 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#25279