| 1 | #ifndef CPR_SSL_CTX_H |
|---|---|
| 2 | #define CPR_SSL_CTX_H |
| 3 | |
| 4 | #include "cpr/ssl_options.h" |
| 5 | #include <curl/curl.h> |
| 6 | |
| 7 | #if SUPPORT_CURLOPT_SSL_CTX_FUNCTION |
| 8 | |
| 9 | namespace cpr { |
| 10 | |
| 11 | /** |
| 12 | * This callback function loads a CA certificate from raw_cert_buf and gets called by libcurl |
| 13 | * just before the initialization of an SSL connection. |
| 14 | * The raw_cert_buf argument is set with the CURLOPT_SSL_CTX_DATA option and has to be a nul |
| 15 | * terminated buffer. |
| 16 | * |
| 17 | * Sources: https://curl.se/libcurl/c/CURLOPT_SSL_CTX_FUNCTION.html |
| 18 | * https://curl.se/libcurl/c/CURLOPT_SSL_CTX_DATA.html |
| 19 | */ |
| 20 | CURLcode sslctx_function_load_ca_cert_from_buffer(CURL* curl, void* sslctx, void* raw_cert_buf); |
| 21 | |
| 22 | } // Namespace cpr |
| 23 | |
| 24 | #endif |
| 25 | |
| 26 | #endif |