diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2009-04-10 16:15:03 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2009-04-10 16:15:03 (GMT) |
commit | 4ec691a9d1a8fc19bf210117eb02cdce49d9660b (patch) | |
tree | d18559e50644372c36b79c0f5f51d499c15e581f /Source/CTest | |
parent | 5783d5aab1654ee185036b665b618f7310d9d3f9 (diff) | |
download | CMake-4ec691a9d1a8fc19bf210117eb02cdce49d9660b.zip CMake-4ec691a9d1a8fc19bf210117eb02cdce49d9660b.tar.gz CMake-4ec691a9d1a8fc19bf210117eb02cdce49d9660b.tar.bz2 |
ENH: add ability to control ssl cert checking
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 4c058c1..089ec74 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -245,7 +245,30 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, /* In windows, this will init the winsock stuff */ ::curl_global_init(CURL_GLOBAL_ALL); - + cmStdString dropMethod(this->CTest->GetCTestConfiguration("DropMethod")); + cmStdString curlopt(this->CTest->GetCTestConfiguration("CurlOptions")); + std::vector<std::string> args; + cmSystemTools::ExpandListArgument(curlopt.c_str(), args); + bool verifyPeerOff = false; + bool verifyHostOff = false; + for( std::vector<std::string>::iterator i = args.begin(); + i != args.end(); ++i) + { + std::cerr << *i << "\n"; + if(*i == "CURLOPT_SSL_VERIFYPEER_OFF") + { + verifyPeerOff = true; + } + if(*i == "CURLOPT_SSL_VERIFYHOST_OFF") + { + verifyHostOff = true; + } + } + bool https = false; + if(dropMethod == "https") + { + https = true; + } cmStdString::size_type kk; cmCTest::SetOfStrings::const_iterator file; for ( file = files.begin(); file != files.end(); ++file ) @@ -254,7 +277,18 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, curl = curl_easy_init(); if(curl) { - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0); + if(verifyPeerOff) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + " Set CURLOPT_SSL_VERIFYPEER to off\n"); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0); + } + if(verifyHostOff) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + " Set CURLOPT_SSL_VERIFYHOST to off\n"); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0); + } // Using proxy if ( this->HTTPProxyType > 0 ) |