mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 01:08:27 +00:00
fix (#1525)
Co-authored-by: Sergey Kazmin <sergey.kazmin@kaspersky.com>
This commit is contained in:
parent
ff34749572
commit
e62a4b02e5
5 changed files with 21 additions and 8 deletions
10
httplib.h
10
httplib.h
|
@ -239,7 +239,7 @@ using socket_t = int;
|
|||
#pragma comment(lib, "crypt32.lib")
|
||||
#pragma comment(lib, "cryptui.lib")
|
||||
#endif
|
||||
#elif defined(__APPLE__)
|
||||
#elif defined(CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN) && defined(__APPLE__)
|
||||
#include <TargetConditionals.h>
|
||||
#if TARGET_OS_OSX
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
@ -2668,7 +2668,7 @@ socket_t create_socket(const std::string &host, const std::string &ip, int port,
|
|||
|
||||
auto sock = socket(hints.ai_family, hints.ai_socktype, hints.ai_protocol);
|
||||
if (sock != INVALID_SOCKET) {
|
||||
sockaddr_un addr {};
|
||||
sockaddr_un addr{};
|
||||
addr.sun_family = AF_UNIX;
|
||||
std::copy(host.begin(), host.end(), addr.sun_path);
|
||||
|
||||
|
@ -4513,7 +4513,7 @@ inline bool load_system_certs_on_windows(X509_STORE *store) {
|
|||
|
||||
return result;
|
||||
}
|
||||
#elif defined(__APPLE__)
|
||||
#elif defined(CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN) && defined(__APPLE__)
|
||||
#if TARGET_OS_OSX
|
||||
template <typename T>
|
||||
using CFObjectPtr =
|
||||
|
@ -8064,9 +8064,9 @@ inline bool SSLClient::load_certs() {
|
|||
#ifdef _WIN32
|
||||
loaded =
|
||||
detail::load_system_certs_on_windows(SSL_CTX_get_cert_store(ctx_));
|
||||
#elif defined(__APPLE__)
|
||||
#elif defined(CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN) && defined(__APPLE__)
|
||||
#if TARGET_OS_OSX
|
||||
loaded = detail::load_system_certs_on_macos(SSL_CTX_get_cert_store(ctx_));
|
||||
loaded = detail::load_system_certs_on_macos(SSL_CTX_get_cert_store(ctx_));
|
||||
#endif // TARGET_OS_OSX
|
||||
#endif // _WIN32
|
||||
if (!loaded) { SSL_CTX_set_default_verify_paths(ctx_); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue