-
Notifications
You must be signed in to change notification settings - Fork 797
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
Added an option native_ca to proj.ini and an environment variable PROJ_NATIVE_CA to be able to configure curl to use the operating system CA store. #4356
Conversation
…variable PROJ_NATIVE_CA to be able to configure curl to use the operating system CA store.
@@ -1622,7 +1627,15 @@ CurlFileHandle::CurlFileHandle(PJ_CONTEXT *ctx, const char *url, CURL *handle) | |||
#if defined(SSL_OPTIONS) | |||
// https://curl.se/libcurl/c/CURLOPT_SSL_OPTIONS.html | |||
auto ssl_options = static_cast<long>(SSL_OPTIONS); | |||
if (pj_context_get_native_ca(ctx)) { | |||
ssl_options = ssl_options | CURLSSLOPT_NATIVE_CA; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From CI failures, it seems that CURLSSLOPT_NATIVE_CA is only available in "recent" Curl versions, so this will need to be conditioned by a #ifdef on the Curl version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your clarification @rouault , I have committed a fix.
…ying to use CURLSSLOPT_NATIVE_CA
…d unused function error.
Co-authored-by: Even Rouault <[email protected]>
Co-authored-by: Even Rouault <[email protected]>
CHECK_RET(ctx, curl_easy_setopt(handle, CURLOPT_SSL_OPTIONS, ssl_options)); | ||
#else | ||
#if CURL_AT_LEAST_VERSION(7, 71, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks to me that this branch ( SSL_OPTIONS not defined but curl >= 7.71) cannot be taken as SSL_OPTIONS is anterior to 7.71
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand, SSL_OPTIONS is a preprocessor definition that is specific to PROJ, it is not defined by curl. It was introduced in this pull request: #3936
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah indeed, I missed that. Looks ok then
docs/source/*.rst
for new API