diff --git a/src/mgr/curlhttpt.cpp b/src/mgr/curlhttpt.cpp index cccd0ba..23db786 100644 --- a/src/mgr/curlhttpt.cpp +++ b/src/mgr/curlhttpt.cpp @@ -144,6 +144,9 @@ char CURLHTTPTransport::getURL(const char *destPath, const char *sourceURL, SWBu /* Switch on full protocol/debug output */ curl_easy_setopt(session, CURLOPT_VERBOSE, true); + /* Disable checking host certificate */ + curl_easy_setopt(session, CURLOPT_SSL_VERIFYPEER, false); + /* FTP connection settings */ #if (LIBCURL_VERSION_MAJOR > 7) || \ diff --git a/src/mgr/installmgr.cpp b/src/mgr/installmgr.cpp index b75df6f..2c28735 100644 --- a/src/mgr/installmgr.cpp +++ b/src/mgr/installmgr.cpp @@ -147,6 +147,7 @@ void InstallMgr::readInstallConf() { ConfigEntMap::iterator sourceEnd; if (confSection != installConf->Sections.end()) { + // Lots of duplicated code in this block now, we could probably refactor it sourceBegin = confSection->second.lower_bound("FTPSource"); sourceEnd = confSection->second.upper_bound("FTPSource"); @@ -169,6 +170,18 @@ void InstallMgr::readInstallConf() { is->localShadow = (SWBuf)privatePath + "/" + is->uid; sourceBegin++; } + + sourceBegin = confSection->second.lower_bound("HTTPSSource"); + sourceEnd = confSection->second.upper_bound("HTTPSSource"); + + while (sourceBegin != sourceEnd) { + InstallSource *is = new InstallSource("HTTPS", sourceBegin->second.c_str()); + sources[is->caption] = is; + SWBuf parent = (SWBuf)privatePath + "/" + is->uid + "/file"; + FileMgr::createParent(parent.c_str()); + is->localShadow = (SWBuf)privatePath + "/" + is->uid; + sourceBegin++; + } } defaultMods.clear(); @@ -282,7 +295,7 @@ SWLog::getSystemLog()->logDebug("netCopy: %s, %s, %s, %c, %s", (is?is->source.c_ trans = createFTPTransport(is->source, statusReporter); trans->setPassive(passive); } - else if (is->type == "HTTP") { + else if (is->type == "HTTP" || is->type == "HTTPS") { trans = createHTTPTransport(is->source, statusReporter); } transport = trans; // set classwide current transport for other thread terminate() call @@ -295,7 +308,13 @@ SWLog::getSystemLog()->logDebug("netCopy: %s, %s, %s, %c, %s", (is?is->source.c_ trans->setPasswd(p); } - SWBuf urlPrefix = (SWBuf)((is->type == "HTTP") ? "http://" : "ftp://") + is->source; + SWBuf urlPrefix = is->source; + if(is->type == "FTP") + urlPrefix = (SWBuf) "ftp://" + urlPrefix; + else if(is->type == "HTTP") + urlPrefix = (SWBuf) "http://" + urlPrefix; + else if(is->type == "HTTPS") + urlPrefix = (SWBuf) "https://" + urlPrefix; // let's be sure we can connect. This seems to be necessary but sucks // SWBuf url = urlPrefix + is->directory.c_str() + "/"; //dont forget the final slash