Add --ignore-ssl-errors flag and SSL certificate documentation #166
+157
−3
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.
Summary
This PR adds support for bypassing SSL certificate verification errors commonly encountered on macOS when Python certificates are not properly installed.
Problem
Users on macOS with Python installed from python.org frequently encounter SSL certificate verification errors when the script tries to geocode cities using the Nominatim API:
Changes Made
1. New Command-Line Flag
--ignore-ssl-errorsflag to bypass SSL certificate verification2. SSL Patching Implementation
ssl._create_default_https_contextwhen flag is enabledgeopy.geocoders.Nominatimto ensure patch takes effect before importget_coordinates()function signature to accept the flag (though patching happens globally)3. Documentation
SSL_CERTIFICATE_ISSUE.mdwith:/Applications/Python X.XX/Install Certificates.command--ignore-ssl-errorsflag (with security warnings)Usage Example
Development/Testing (with flag):
Recommended Approach (install certificates):
Testing
Security Note
The
--ignore-ssl-errorsflag is provided as a convenience for development and testing only. Users should be strongly encouraged to install proper SSL certificates using the recommended method.Related Issues
Addresses SSL certificate verification failures on macOS when using Python installed from python.org (not system Python or Homebrew).
Fixes: Certificate verification errors with nominatim.openstreetmap.org geocoding requests