I am trying to build a C++ app to access a XML resource. Using http the code works fine, from what I can tell from the docs, all I need to do to for the https to work is to make sure ssl is install (yes the dev edition is installed), and change the StreamFactory to HTTPSStreamFactory.
Here is the code that works :
Poco::Net::HTTPStreamFactory::registerFactory();
Poco::URI uri(argv[1]);
std::auto_ptr<std::istream> pStr(Poco::URIStreamOpener::defaultOpener().open(uri));
std::string str;
StreamCopier::copyToString(*pStr.get(), str);
Here is the code that fails Poco::Net::HTTPSStreamFactory::registerFactory(); Poco::URI uri(argv[1]);
std::auto_ptr<std::istream> pStr(Poco::URIStreamOpener::defaultOpener().open(uri));
std::string str;
StreamCopier::copyToString(*pStr.get(), str);
When I make a request w/ HTTPSStreamFactory this is the error message I get :
NULL pointer: _pInstance [in file "/home/chpick/poco-1.3.6p2/Util/include/Poco/Util/Application.h", line 422]
I have attached the Application.h
inline Application& Application::instance()
{
poco_check_ptr (_pInstance);
return *_pInstance;
}
Any help would be great. Thanks