Skip to content

Add CA certificate bundle path override for SSL issues#316

Open
bananna-droid wants to merge 3 commits into
godotengine:masterfrom
bananna-droid:fix-ssl-cert-path-override
Open

Add CA certificate bundle path override for SSL issues#316
bananna-droid wants to merge 3 commits into
godotengine:masterfrom
bananna-droid:fix-ssl-cert-path-override

Conversation

@bananna-droid

@bananna-droid bananna-droid commented Jan 26, 2026

Copy link
Copy Markdown

Description

Adds support for custom CA certificate bundle path configuration to resolve SSL certificate validation failures.

Fixes

#146

Affected Platforms

This issue affects all platforms (Linux, Windows, macOS), not just Linux:

  • Linux: Confirmed on Ubuntu 24.04 / Pop!_OS 24.04 (tested by me)
  • Windows: Confirmed on Windows 10 (tested by me)
  • macOS: Likely affected (same root cause)

The plugin appears to be built with OpenSSL on all platforms, which fails to locate system CA certificates without proper configuration.

Testing

  • ✅ Tested and working on Linux (Ubuntu 24.04, Pop!_OS 24.04) with Godot 4.5.1 and 4.6
  • ✅ Tested and working on Windows 10 VM with Godot 4.6

Changes

  • Added ca_bundle_path member and set_ca_bundle_path() method to GitPlugin
  • Implemented automatic config loading from ca_cert_config.txt
  • Uses git_libgit2_opts(GIT_OPT_SET_SSL_CERT_LOCATIONS) for runtime certificate configuration
  • Included template config file with examples for common Linux distributions

Testing

Tested on Linux with custom CA bundle path. SSL operations (fetch/pull/push) now work correctly when config file is present.

Behavior

  • Opt-in: No changes to default behavior
  • Zero impact: Users without the config file experience no changes
  • User-friendly: Simple text file configuration, no code modifications needed

Example Config File

# ca_cert_config.txt
/etc/ssl/certs/ca-certificates.crt

Rationale

While ideally libgit2 would auto-detect certificate locations on all systems, this provides users immediate control in environments where auto-detection fails. This follows the same pattern as curl's --cacert and git's http.sslCAInfo options.

Fix for linux for issue 146

Allows users to specify a custom CA certificate bundle path via
ca_cert_config.txt configuration file. This addresses SSL certificate
validation failures on Linux systems where libgit2's default certificate
detection fails.

Implementation uses git_libgit2_opts(GIT_OPT_SET_SSL_CERT_LOCATIONS)
to set the certificate path at runtime.
The feature is opt-in and should have zero impact on existing users.
@Calinou Calinou added the bug label Jan 27, 2026
@Contradox

Copy link
Copy Markdown

I'm using Godot 4.6.1 on Windows 11 and am trying to fix this issue with the Git Plugin (Version 3.2.1) but I don't understand how to perform the changes listed in the above comment.

@bananna-droid

Copy link
Copy Markdown
Author

This fork of the plugin can behave identically to the current public release if all the lines in the text file are commented out. The plugin reads the file top to bottom and stops at the first non-comment line it finds, so only uncomment one entry at a time. The file to edit is ca_cert_config.txt which is located in the folder of the plugin, just have an uncomment line with the full path to the file. It includes a couple of paths predefined but commented out.
But if you uncomment one line, that path is used and will take precedence when the plugin starts and will configure the libgit2 override to use the specified path to (hopefully valid) ca-bundle.crt file to which it will then use to verify remote certs instead of the one the plugin is originally built with.
Check in your git install for a ca-bundle, possible location paths to use with windows are

C:/Program Files/Git/mingw64/etc/ssl/certs/ca-bundle.crt
C:/Program Files/Git/usr/ssl/certs/ca-bundle.crt

If whatever reason there isn't any bundle in the git install, it can also work with the versions downloaded from https://curl.se/docs/caextract.html for ca-bundle.crt, just adjust the path to wherever you have the file at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants