comparison Core/HttpClient.h @ 1534:95b3b0260240

Options to validate peers against CA certificates in HTTPS requests
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 13 Aug 2015 12:42:32 +0200
parents 0011cc99443c
children ba0226474e22
comparison
equal deleted inserted replaced
1533:0011cc99443c 1534:95b3b0260240
52 HttpStatus lastStatus_; 52 HttpStatus lastStatus_;
53 std::string postData_; 53 std::string postData_;
54 bool isVerbose_; 54 bool isVerbose_;
55 long timeout_; 55 long timeout_;
56 std::string proxy_; 56 std::string proxy_;
57 bool verifyPeers_;
58 std::string caCertificates_;
57 59
58 void Setup(); 60 void Setup();
59 61
60 void operator= (const HttpClient&); // Forbidden 62 void operator= (const HttpClient&); // Forbidden
61 63
138 void SetProxy(const std::string& proxy) 140 void SetProxy(const std::string& proxy)
139 { 141 {
140 proxy_ = proxy; 142 proxy_ = proxy;
141 } 143 }
142 144
145 void SetHttpsVerifyPeers(bool verify)
146 {
147 verifyPeers_ = verify;
148 }
149
150 bool IsHttpsVerifyPeers() const
151 {
152 return verifyPeers_;
153 }
154
155 void SetHttpsCACertificates(const std::string& certificates)
156 {
157 caCertificates_ = certificates;
158 }
159
160 const std::string& GetHttpsCACertificates() const;
161
143 static void GlobalInitialize(bool httpsVerifyPeers, 162 static void GlobalInitialize(bool httpsVerifyPeers,
144 const std::string& httpsVerifyCertificates); 163 const std::string& httpsCACertificates);
145 164
146 static void GlobalFinalize(); 165 static void GlobalFinalize();
147 }; 166 };
148 } 167 }