C
C
continue2015-10-22 17:47:23
C++ / C#
continue, 2015-10-22 17:47:23

C++ | boost::asio+ssl?

Good day!
I would like to know how to connect via SSL?

int main()
{
  boost::asio::ip::tcp::iostream stream;
  stream.expires_from_now(boost::posix_time::seconds(60));
  stream.connect("api.vk.com", "http");
  if (!stream)
  {
    std::cout << "Error: " << stream.error().message() << "\n";
  }
  stream << "GET тут запрос";
  stream.flush();
  std::cout << stream.rdbuf();
  system("pause");
  return 0;
}

You need to connect with this code via https, thanks in advance!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Stanislav Makarov, 2015-10-22
@Nipheris

Instructions for Boost::ASIO: www.boost.org/doc/libs/1_59_0/doc/html/boost_asio/...
Using the HTTP client in cpp-netlib with HTTPS connectivity: cpp-netlib.org/0.11. 1/reference/http_client.html

F
fuzz0, 2015-10-22
@fuzz0

is it necessary to use asio?
you can try making https requests with Poco
pocoproject.org/docs/Poco.Net.HTTPRequest.html

C
continue, 2015-10-23
@continue

I can’t find examples with Poco, if it’s not difficult, throw a link)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question