- Notifications
You must be signed in to change notification settings - Fork425
Fix for issue #444 "Unable to compile without OpenSSL"#541
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Fix for issue #444 "Unable to compile without OpenSSL"#541
Uh oh!
There was an error while loading.Please reload this page.
Conversation
- add an option CPP-NETLIB_ENABLE_HTTPS to enable/disable HTTPS in cmake config. By default it is turned ON (enable HTTPS) so as to preserve before-patch behavior. Turn it OFF to disable entirely SSL usage and linkage in libraries and header files.- when SSL is disabled, the 'stream_handler' struct is replaced by a simple tcp_socket, and function calls in the files option.hpp, async_server.hpp and async_connection.hpp are adapted and compiled accordingly.Note that sync_...hpp files don't have problems (yet) since SSL isnot integrated into these. Also note that a cleaner solution mightbe to consider implementing two separate struct 'stream_handler' and'stream_handler_ssl', or something similar.
Thanks@celsius -- can you also update the travis config too, so we can make sure this doesn't break in the configurations we care about and test continuously? |
I've never used travis before, am I supposed to add this into the "env:" section of ".travis.yml" ? I'm asking because it would increase the number of compilation tests by a factor 2 (i.e. each test would be made with with HTTPS ON or OFF). If that's ok with you, then I'll proceed. |
Yes@celsius -- thanks in advance! |
@deanberris pushed and Travis CI build passed. Always happy to help. |
LGTM -- thanks@celsius! |
Fix for issue#444 "Unable to compile without OpenSSL"
Note that sync_...hpp files don't have problems (yet) since SSL is not integrated into these. Also note that a cleaner solution might be to consider implementing two separate struct 'stream_handler' and 'stream_handler_ssl', or something similar (in order to avoid most, if not all, the current #ifdef added by the commit in async_server and async_connection).
The changes to the code are quite simple but, for the record, I compiled this with the new option ON and OFF and successfully tested it for both configurations with a slightly adapted version of the asynchronous http server "hello world" example. I tried to be thorough while searching the code for SSL-related code, but I'm not very familiar with the whole code base, so some parts may have slipped past my attention.