add methods to set a client certificate/key and the CA in the Http class
This commit is contained in:
@@ -219,6 +219,28 @@ public:
|
||||
*/
|
||||
void verify_ssl(bool verify);
|
||||
|
||||
/*
|
||||
* a path to the CA to verify the peer
|
||||
* used with CURLOPT_CAINFO
|
||||
* https://curl.se/libcurl/c/CURLOPT_CAINFO.html
|
||||
*
|
||||
* we do not copy the string but only get a pointer to its c_str()
|
||||
*/
|
||||
void set_ca_file(const wchar_t * path);
|
||||
void set_ca_file(const std::wstring & path);
|
||||
|
||||
/*
|
||||
* set a client certificate and a private key
|
||||
*
|
||||
* used with:
|
||||
* https://curl.se/libcurl/c/CURLOPT_SSLCERT.html
|
||||
* https://curl.se/libcurl/c/CURLOPT_SSLKEY.html
|
||||
*
|
||||
* we do not copy the string but only get a pointer to its c_str()
|
||||
*/
|
||||
void set_client_cert(const wchar_t * client_cert, const wchar_t * client_key);
|
||||
void set_client_cert(const std::wstring & client_cert, const std::wstring & client_key);
|
||||
|
||||
/*
|
||||
* in can be a null pointer
|
||||
* in such a case a body payload is not sent
|
||||
@@ -273,6 +295,12 @@ private:
|
||||
bool verify_ssl_cert;
|
||||
bool forse_ssl_version;
|
||||
long ssl_version;
|
||||
const wchar_t * ca_path;
|
||||
std::string ca_path_utf8;
|
||||
const wchar_t * client_cert;
|
||||
const wchar_t * client_key;
|
||||
std::string client_cert_utf8;
|
||||
std::string client_key_utf8;
|
||||
|
||||
std::wstring temp_header;
|
||||
std::string temp_header_ascii;
|
||||
|
Reference in New Issue
Block a user