Overview
Features
Download
Documentation
Community
Add-Ons & Services

HTTPSClientSession in Poco terminating with exception

Please post support and help requests here.

HTTPSClientSession in Poco terminating with exception

Postby HemDutt » 25 Jun 2014, 10:56

this is part of my code

Code: Select all
#include "Poco/Net/HTTPRequest.h"
#include "Poco/URI.h"
#include "Poco/Net/HTTPResponse.h"
#include "Poco/Net/HTTPSClientSession.h"

int main(int argc, const char * argv[])
{   
   Poco::URI uri("https://www.testserver.com");
    const Poco::Net::Context::Ptr context = new Poco::Net::Context(Poco::Net::Context::CLIENT_USE, "", "", "", Poco::Net::Context::VERIFY_NONE, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
    Poco::Net::HTTPSClientSession session(uri.getHost(), uri.getPort(), context);
     
     // prepare path
     std::string path(uri.getPathAndQuery());
     if (path.empty()) path = "/";
     
     // send request
     std::cout << path;
     Poco::Net::HTTPRequest req(Poco::Net::HTTPRequest::HTTP_GET, path, Poco::Net::HTTPMessage::HTTP_1_1);
     session.sendRequest(req);


The program is terminating with exception libc++abi.dylib: terminate called throwing an exception while sending the request.

What is the correct way of sending request using HTTPS session?
HemDutt
 
Posts: 11
Joined: 24 Jun 2014, 14:21

Re: HTTPSClientSession in Poco terminating with exception

Postby HemDutt » 25 Jun 2014, 14:11

It seems when server not found , then the connection throws this exception. Is there any way to manage this without crashing?
HemDutt
 
Posts: 11
Joined: 24 Jun 2014, 14:21

Re: HTTPSClientSession in Poco terminating with exception

Postby gregee123 » 26 Jun 2014, 00:26

catch the exception?
currently using: 1.5.4
gregee123
 
Posts: 55
Joined: 29 Mar 2013, 12:11


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests