Commit 33ac3eb5 authored by Max Kellermann's avatar Max Kellermann

lib/curl/Easy: add methods SetVerify{Host,Peer}()

parent d56a51cb
......@@ -432,8 +432,8 @@ CurlInputStream::InitEasy()
StringFormat<1024>("%s:%s", proxy_user,
proxy_password).c_str());
request->SetOption(CURLOPT_SSL_VERIFYPEER, verify_peer ? 1L : 0L);
request->SetOption(CURLOPT_SSL_VERIFYHOST, verify_host ? 2L : 0L);
request->SetVerifyPeer(verify_peer);
request->SetVerifyHost(verify_host);
request->SetOption(CURLOPT_HTTPHEADER, request_headers.Get());
}
......
......@@ -136,6 +136,14 @@ public:
SetOption(CURLOPT_FAILONERROR, (long)value);
}
void SetVerifyHost(bool value) {
SetOption(CURLOPT_SSL_VERIFYHOST, value ? 2L : 0L);
}
void SetVerifyPeer(bool value) {
SetOption(CURLOPT_SSL_VERIFYPEER, (long)value);
}
void SetConnectTimeout(long timeout) {
SetOption(CURLOPT_CONNECTTIMEOUT, timeout);
}
......
......@@ -120,6 +120,14 @@ public:
easy.SetRequestHeaders(request_headers);
}
void SetVerifyHost(bool value) {
easy.SetVerifyHost(value);
}
void SetVerifyPeer(bool value) {
easy.SetVerifyPeer(value);
}
void SetNoBody(bool value=true) {
easy.SetNoBody(value);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment