Comments (3)
@arekmula thanks for reporting!
You are right, there is no real support for it yet. But I will try to add support for it over the weekend if everything goes as planed.
The Interface would than look something like:
/**
* This callback function gets called by libcurl just before the initialization of an SSL connection
* after having processed all other SSL related options to give a last chance to an application
* to modify the behavior of the SSL initialization.
*
* If an error is returned from the callback no attempt to establish a connection is made
* and the perform operation returns the callback's error code.
* For no error return CURLE_OK from inside 'curl/curl.h'
*
* More/Source: https://curl.se/libcurl/c/CURLOPT_SSL_CTX_FUNCTION.html
**/
void SetSslCtxCallback(const SslCtxCallback& ssl_ctx);
Resulting in something like:
std::function<CURLcode(const std::shared_ptr<CurlHolder>& curl_holder, void* ssl_ctx, intptr_t userdata)>
for your custom callback.
from cpr.
I have it already implemented and tested on my side. I can raise the MR. I would only need to adapt the API slightly to your proposed one and cover it with tests.
from cpr.
Raised the WIP Pull request: #1020
I was not sure about passing the CurlHolder
. There's no constructor of CurlHolder
accepting CURL*
which I could use inside of sslCtxUserFunction
. We can pass CURL*
or don't pass it at all.
Tests are missing but I will try to add them tomorrow or on monday.
from cpr.
Related Issues (20)
- Built-in curl link to libssh2 automatically HOT 8
- Failed to build with ndk HOT 7
- cpr::Download failed to decode downloaded content of gzip encoding HOT 4
- trying to use discord webhook api: St12length_error - basic_string::_M_create HOT 1
- CMake target exports are not created if not using system curl HOT 3
- Handling SSE HOT 3
- build error for android using cmake on macOS HOT 1
- HTTPS segmentation fault, but HTTP will not. HOT 2
- Link error when setting -DCMAKE_BUILD_TYPE=Debug HOT 4
- SetUrl() does not update new URLs properly within same Session() object HOT 1
- Question: Is `WriteCallback` asynchronous? HOT 1
- cpr::Buffer data lifetime question HOT 4
- constexpr methods for some string-like types HOT 1
- Add support for identifying whether a Session is currently busy or not HOT 1
- zlib ignores --prefix/CMAKE_INSTALL_PREFIX when using cpr as external dependency HOT 2
- Link error when creating a cpr::Header, segment fault when making cpr::Get request HOT 1
- Question: Does cpr support ftp? HOT 1
- Confused on something HOT 3
- Call of overloaded ‘SetOption(std::__cxx11::basic_string<char>)’ is ambiguous HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpr.