You need to register the http and https protocols.
And for handling "https" you also need to configure SSLManager with a certificate and context, here is an example code snippet:
//register http and https HTTPSessionFactory::defaultFactory().registerProtocol("http", new HTTPSessionInstantiator); HTTPSessionFactory::defaultFactory().registerProtocol("https", new HTTPSSessionInstantiator); //prepare for SSLManager SharedPtr ptrCert = new AcceptCertificateHandler(false); const Poco::Net::Context::Ptr context = new Context(Context::CLIENT_USE, "", "", "", Context::VERIFY_NONE, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"); SSLManager::instance().initializeClient(0, ptrCert, context); // now you have the HTTP(S)ClientSession HTTPClientSession *session = HTTPSessionFactory::defaultFactory().createClientSession(uri);
source share