This patch is necessary to build cpp-httplib in Crashpad, itself in
Chromium, using BoringSSL. Details at [1].
The fixes include:
- Library version check: tolerate BoringSSL as an alternative to
OpenSSL 3.
- Don’t call `OPENSSL_thread_stop`, which is not in BoringSSL.
- Use `SSL_get_peer_certificate` (deprecated in OpenSSL 3), the old
name for `SSL_get1_peer_certificate`, because the new name is not in
BoringSSL.
- Call `SSL_set_tlsext_host_name` directly instead of making an
`SSL_ctrl` call that BoringSSL does not support. The feared
-Wold-style-cast warning that occurs when buidling with OpenSSL is
not triggered in BoringSSL.
[1] 1a62a01825
The test used the hardcoded long value for 64 bit machines even on 32
bit ones, leading to test failures. With this patch the max long length
is obtained using std::numeric_limits<long>::max(). Thanks to q2a3z for
the hint!
Fixes: https://github.com/yhirose/cpp-httplib/issues/1795
* New function SSLServer::update_certs. Allows to update certificates while server is running
* New function SSLServer::update_certs. Added unit test
* avoid memory leaks if linked with static openssl libs
---------
Co-authored-by: CEU\schielke <Rainer.Schielke@heidelberg.com>
* New function SSLServer::update_certs. Allows to update certificates while server is running
* New function SSLServer::update_certs. Added unit test
---------
Co-authored-by: CEU\schielke <Rainer.Schielke@heidelberg.com>
Release builds result in the following warning because `content_length` param was used only inside asserts:
1> cpp-httplib\httplib.h(4933,45): warning C4100: 'content_length': unreferenced formal parameter
* Windows has WSAAccept() which will create sockets inheriting flags from
the server socket
* Linux has accept4() which has a flags argument supporting SOCK_CLOEXEC
* Implement string divider to replace splitter
* Divide query string in half
* Add a test case for query values containing the '=' character
* Add test cases for string divider
* Fix warnings
* Move httplibConfig.cmake.in to cmake dir
Just makes more sense to put it there I suppose.
* Cmake install README & License
Seems to make sense since you might already do this as a package
manager, or an end user might want them anyways.
The locations are just based on standard Linux locations using
GNUInstallDirs, so it should be sane on other machines too.
using lambda expression as Handler in set_error_handler will cause ambiguous.
Template forwarding can forward HandlerWithResponse to the correct overloading function