summaryrefslogtreecommitdiff
path: root/indra/llmessage/llcurl.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-04-07 13:08:54 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-04-07 13:08:54 +0100
commit58d1999d47baebc9af3c566b61401a946da40073 (patch)
tree72735031bf727bff369be3e30acac69192a51fcc /indra/llmessage/llcurl.cpp
parente07937ced233513bcae55b2365f9ba5a15108faa (diff)
parentadce2ecdf8f3a0efcd4907699d286012124ac496 (diff)
merge from viewer-trunk
Diffstat (limited to 'indra/llmessage/llcurl.cpp')
-rw-r--r--indra/llmessage/llcurl.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 7c6660e28b..5caf620059 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -90,6 +90,10 @@ S32 gCurlMultiCount = 0;
std::vector<LLMutex*> LLCurl::sSSLMutex;
std::string LLCurl::sCAPath;
std::string LLCurl::sCAFile;
+// Verify SSL certificates by default (matches libcurl default). The ability
+// to alter this flag is only to allow us to suppress verification if it's
+// broken for some reason.
+bool LLCurl::sSSLVerify = true;
//static
void LLCurl::setCAPath(const std::string& path)
@@ -104,6 +108,18 @@ void LLCurl::setCAFile(const std::string& file)
}
//static
+void LLCurl::setSSLVerify(bool verify)
+{
+ sSSLVerify = verify;
+}
+
+//static
+bool LLCurl::getSSLVerify()
+{
+ return sSSLVerify;
+}
+
+//static
std::string LLCurl::getVersionString()
{
return std::string(curl_version());
@@ -528,7 +544,7 @@ void LLCurl::Easy::prepRequest(const std::string& url,
setErrorBuffer();
setCA();
- setopt(CURLOPT_SSL_VERIFYPEER, true);
+ setopt(CURLOPT_SSL_VERIFYPEER, LLCurl::getSSLVerify());
//setopt(CURLOPT_SSL_VERIFYHOST, LLCurl::getSSLVerify()? 2 : 0);
//don't verify host name so urls with scrubbed host names will work (improves DNS performance)
@@ -999,15 +1015,6 @@ void LLCurlEasyRequest::setReadCallback(curl_read_callback callback, void* userd
}
}
-void LLCurlEasyRequest::setSSLCtxCallback(curl_ssl_ctx_callback callback, void* userdata)
-{
- if (mEasy)
- {
- mEasy->setopt(CURLOPT_SSL_CTX_FUNCTION, (void*)callback);
- mEasy->setopt(CURLOPT_SSL_CTX_DATA, userdata);
- }
-}
-
void LLCurlEasyRequest::slist_append(const char* str)
{
if (mEasy)
@@ -1175,4 +1182,3 @@ void LLCurl::cleanupClass()
}
}
-