c++ - Poco NetSSL Exception -


i have built poco netssl, first example doesn't work. following snippet throws exception , debugger.h gets opened in ide (visual studio 2012).

#include <poco/net/httpsclientsession.h>  int main() {     poco::net::httpsclientsession clientsession; } 

this output:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% null pointer: _pinstance [in file "c:\users\domenic\desktop\poco-1.4.6p1-all\util\include\poco\util\application.h", line 446] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

the following code works perfectly...

#include <poco/net/httpclientsession.h>  int main() {     poco::net::httpclientsession clientsession; } 

i suppose has openssl. can me, want start project. :(

if you're using default constructor of poco::net::httpsclientsession (or other constructor not take poco::net::context::ptr), you'll need have instance of poco::util::application, configuration file containing ssl/tls configuration in order create default context object , initialize poco::net::sslmanager, or alternatively, initialize default context , sslmanager yourself.

initializing default context , sslmanager involves creating certificate handler, creating default context object , initializing sslmanager. see mail , download samples how done. typically, code looks this:

poco::sharedptr<poco::net::invalidcertificatehandler> pcert =      new poco::net::consolecertificatehandler(false);  poco::net::context::ptr pcontext =      new poco::net::context(         poco::net::context::client_use,          "",          "",          "rootcert.pem",          poco::net::context::verify_relaxed,          9,          false,          "all:!adh:!low:!exp:!md5:@strength"); sslmanager::instance().initializeclient(0, pcert, pcontext); 

Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -