Honor SSL config settings for ValidatorSites:

FIXES: #2990

* refactor common SSL client setup
* enable SSL in unit-test http server
* add tests for SSLHTTPDownloader
* misc test refactoring
This commit is contained in:
Mike Ellery
2019-08-05 09:47:09 -07:00
parent fc7ecd672a
commit 9213c49ca1
20 changed files with 1135 additions and 534 deletions

View File

@@ -113,6 +113,13 @@ ShardArchiveHandler::start()
// Create temp root download directory
create_directory(downloadDir_);
if (!downloader_)
{
// will throw if can't initialize ssl context
downloader_ = std::make_shared<SSLHTTPDownloader>(
app_.getIOService(), j_, app_.config());
}
}
catch (std::exception const& e)
{
@@ -121,16 +128,6 @@ ShardArchiveHandler::start()
return false;
}
if (!downloader_)
{
downloader_ = std::make_shared<SSLHTTPDownloader>(
app_.getIOService(), j_);
if (!downloader_->init(app_.config()))
{
downloader_.reset();
return false;
}
}
return next(lock);
}