void HTTPSClientSessionTest::testInterop() { HTTPSClientSession s("secure.appinf.com"); HTTPRequest request(HTTPRequest::HTTP_GET, "/public/poco/NetSSL.txt"); s.sendRequest(request); 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"); }
void HTTPSClientSessionTest::testProxy() { HTTPSTestServer srv; HTTPSClientSession s("secure.appinf.com"); s.setProxy( Application::instance().config().getString("testsuite.proxy.host"), Application::instance().config().getInt("testsuite.proxy.port") ); HTTPRequest request(HTTPRequest::HTTP_GET, "/public/poco/NetSSL.txt"); s.sendRequest(request); 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"); }