added https->http redirect, improved redirect support in streamfactory, fixed client cert validation error

This commit is contained in:
Peter Schojer
2008-12-19 08:10:04 +00:00
parent f84e0947f7
commit 8a2502bce4
5 changed files with 92 additions and 47 deletions

View File

@@ -31,6 +31,7 @@
#include "HTTPSClientSessionTest.h"
#include "HTTPSClientTestSuite.h"
#include "CppUnit/TestCaller.h"
#include "CppUnit/TestSuite.h"
#include "Poco/Net/HTTPSClientSession.h"
@@ -336,7 +337,7 @@ void HTTPSClientSessionTest::testKeepAlive()
void HTTPSClientSessionTest::testProxy()
{
HTTPSTestServer srv;
HTTPSClientSession s("wwws.appinf.com");
HTTPSClientSession s(TESTSERVERNAME);
s.setProxy("proxy.aon.at", 8080);
HTTPRequest request(HTTPRequest::HTTP_GET, "/");
s.sendRequest(request);
@@ -351,7 +352,7 @@ void HTTPSClientSessionTest::testProxy()
void HTTPSClientSessionTest::testConnectNB()
{
SecureStreamSocket sock;
sock.connectNB(SocketAddress("server.com", 443));
sock.connectNB(SocketAddress(TESTSERVERNAME, 443));
char buf[512];
std::string msg("GET / HTTP/1.0\r\n\r\n");
sock.sendBytes(msg.c_str(), (int)msg.length());

View File

@@ -39,6 +39,8 @@
#include "CppUnit/TestSuite.h"
#define TESTSERVERNAME "secure.appinf.com"
class HTTPSClientTestSuite
{
public:

View File

@@ -31,6 +31,7 @@
#include "HTTPSStreamFactoryTest.h"
#include "HTTPSClientTestSuite.h"
#include "CppUnit/TestCaller.h"
#include "CppUnit/TestSuite.h"
#include "Poco/Net/HTTPSStreamFactory.h"
@@ -103,7 +104,7 @@ void HTTPSStreamFactoryTest::testProxy()
{
HTTPSTestServer server;
HTTPSStreamFactory factory("proxy.aon.at", 8080);
URI uri("https://wwws.appinf.com/");
URI uri(std::string("https://") + TESTSERVERNAME + "/");
std::auto_ptr<std::istream> pStr(factory.open(uri));
std::ostringstream ostr;
StreamCopier::copyStream(*pStr.get(), ostr);