Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV in http_client during SSL handshake with http_server #75

Open
beginjd opened this issue Feb 17, 2016 · 1 comment
Open

SIGSEGV in http_client during SSL handshake with http_server #75

beginjd opened this issue Feb 17, 2016 · 1 comment

Comments

@beginjd
Copy link

beginjd commented Feb 17, 2016

I am using the development branch to write a REST server, because I need SSL. I am running under RHEL 7.1. Writing tests using the BOOST test framework, I am able to create a client that successfully connects to google and others using SSL. When trying to connect to my REST server, I get a SIGSEGV (see attached). Note that I can sucessfully execute SSL requests to the server using SOAPUI. I am using BOOST 1.58. The problem seems to be with some Boost inline code in error_code.hpp, which is invoked in http_client_asio.cpp/report_error(). Basically, to get the error handled without a SIGSEGV, I had to change:
ec == boost::system::errc::operation_canceled
to
ec.value() == boost::system::errc::operation_canceled

I changed all similar comparisons in report_error(). Now I get a nice std::exception and an "Error in SSL handshake" explanation string. Next is finding out why I can't connect, but that's an issue for another day...

Note: This happened when connecting to a server using test certificate and key. I was also missing
client_config.set_validate_certificates(false);
Once I added the line above, the error (the SIGSEGV) doesn't occur, probably because there is no error checking... So when it works, it works. It only fails when it fails ;)

CPPRESTSDK SIGSEGV.txt

@samhatchett
Copy link

+1 on Mac - SIGSEGV when the host is unreachable but only when the library is built as static. The fix above was the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants