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

@@ -94,6 +94,29 @@ public:
operator beast::Journal&() { return journal_; }
};
// this sink can be used to create a custom journal
// whose log messages will be captured to a stringstream
// that can be later inspected.
class StreamSink : public beast::Journal::Sink
{
std::stringstream strm_;
public:
StreamSink (
beast::severities::Severity threshold = beast::severities::kDebug)
: Sink (threshold, false) { }
void
write (beast::severities::Severity level,
std::string const& text) override
{
if (level < threshold())
return;
strm_ << text << std::endl;
}
std::stringstream const& messages() const { return strm_ ; }
};
} // test
} // ripple