optimizations, certificate verification, code cleanup

This commit is contained in:
Günter Obiltschnig
2014-10-09 20:54:07 +02:00
parent 5b0fa2e06a
commit 80952e11d1
10 changed files with 596 additions and 397 deletions

View File

@@ -293,13 +293,21 @@ void HTTPSClientSessionTest::testInterop()
HTTPRequest request(HTTPRequest::HTTP_GET, "/public/poco/NetSSL.txt");
s.sendRequest(request);
Poco::Net::X509Certificate cert = s.serverCertificate();
HTTPResponse response;
std::istream& rs = s.receiveResponse(response);
std::ostringstream ostr;
StreamCopier::copyStream(rs, ostr);
std::string str(ostr.str());
assert (str == "This is a test file for NetSSL.\n");
assert (cert.commonName() == "secure.appinf.com" || cert.commonName() == "*.appinf.com");
std::string commonName;
std::set<std::string> domainNames;
cert.extractNames(commonName, domainNames);
assert (commonName == "secure.appinf.com" || commonName == "*.appinf.com");
assert (domainNames.find("appinf.com") != domainNames.end()
|| domainNames.find("*.appinf.com") != domainNames.end());
}