Boost :: asio handshake via http proxy?

Brand new for boost and asio, need help:

  • connect to the proxy asio::ip::tcp::socket socket_;

  • send host CONNECT: ssl server to proxy server receive response 200

  • asio::ssl::context ctx(io_service, asio::ssl::context::sslv23); sslsocket_(socket_,context)
  • try shaking hands sslsocket_.async_handshake(asio::ssl::stream_base::client, boost::bind(&client::handle_handshake, this, asio::placeholders::error));

  • and get the error asio.ssl Wireshark: host sends FIN after 1st message of handshake

Direct asynchronous connection to ssl server works fine, the same via Proxifier

0
source share
2 answers

I forgot to mention that I was running the application in VMplayer with a NAT network; the pavement removed the problem with the initial handshake, but sometimes after reconnecting it saw the same message; using the method in Sam’s connection, he received an “unexpected record” during a handshake - Google said this error was a revision, but this was not so; digging in OpenSSL sources: the new connection used the same BIO to read and receive application data from the previous connection I don’t know how to reset the SSL structure with asio, so dynamic allocation of sockets using the new | delete

+1
source

You will probably need to examine the OpenSSL error stack in step 5, which is not so simple since Boost.Asio does not map it to the regular system_error codes that it uses. Recently, a post was introduced on the asio mailing list that describes how to change the source to accomplish this.

+1
source

All Articles