Skip to content

Commit

Permalink
SSL_OPTIONS: set SSL options on Curl library (#3936)
Browse files Browse the repository at this point in the history
  • Loading branch information
ollira authored Nov 2, 2023
1 parent 576fbc4 commit dc184bd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ if(ENABLE_CURL)
INTERFACE_LINK_LIBRARIES "${CURL_LIBRARIES}"
)
endif()

# Curl SSL options are described in
# https://curl.se/libcurl/c/CURLOPT_SSL_OPTIONS.html
#set(CURLSSLOPT_NO_REVOKE 2)
#set(SSL_OPTIONS ${CURLSSLOPT_NO_REVOKE})
#add_compile_definitions(SSL_OPTIONS=${SSL_OPTIONS})

else()
message(SEND_ERROR "curl dependency not found!")
endif()
Expand Down
7 changes: 7 additions & 0 deletions src/networkfilemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1620,6 +1620,13 @@ CurlFileHandle::CurlFileHandle(PJ_CONTEXT *ctx, const char *url, CURL *handle)
CHECK_RET(ctx, curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 0L));
}

#if defined(SSL_OPTIONS)
// https://curl.se/libcurl/c/CURLOPT_SSL_OPTIONS.html
auto ssl_options = static_cast<long>(SSL_OPTIONS);
CHECK_RET(ctx,
curl_easy_setopt(handle, CURLOPT_SSL_OPTIONS, ssl_options));
#endif

const auto ca_bundle_path = pj_context_get_bundle_path(ctx);
if (!ca_bundle_path.empty()) {
CHECK_RET(ctx, curl_easy_setopt(handle, CURLOPT_CAINFO,
Expand Down

0 comments on commit dc184bd

Please sign in to comment.