Fix SSL certificate loading on macOS systems - #1928
Closed
vinayK34 wants to merge 1 commit into
Closed
Conversation
This fix addresses the issue where HTTPie fails to verify SSL certificates on macOS systems even when certifi is installed. The problem occurs because the default certificate loading mechanism doesn't work properly on macOS, causing "SSLCertVerificationError: certificate verify failed: unable to get local issuer certificate" errors. The fix detects macOS systems and attempts to load certificates using certifi as a fallback when the default load_default_certs() fails.
vinayK34
marked this pull request as ready for review
August 11, 2026 07:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the issue where HTTPie fails to verify SSL certificates on macOS systems even when certifi is installed.
Problem
On macOS, when
verify=True(which is the default), HTTPie fails with:The root cause is that the default certificate loading mechanism doesn't work properly on macOS systems, causing certificate verification to fail.
Solution
The fix modifies
ensure_default_certs_loadedinhttpie/compat.pyto:certifi.where()as a fallback whenload_default_certs()failsTesting
This fix has been tested on macOS and should resolve the issue described in #1632 where
https get google.comfails with certificate verification errors.