mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-18 11:09:39 +00:00
Fix #2421
This commit is contained in:
1 parent
fc885cc62d
commit
4f589c1ffb
2 files changed
+4
-4
No files matched your search
@@ -191,7 +191,7 @@ cpp-httplib automatically integrates with the OS certificate store on macOS and
|
|||||||
|
|
||||||
| Platform | Behavior | Disable (compile time) |
|
| Platform | Behavior | Disable (compile time) |
|
||||||
| :------- | :------- | :--------------------- |
|
| :------- | :------- | :--------------------- |
|
||||||
| macOS | Loads system certs from Keychain (link `CoreFoundation` and `Security` with `-framework`) | `CPPHTTPLIB_DISABLE_MACOSX_AUTOMATIC_ROOT_CERTIFICATES` |
|
| macOS | Loads system certs from Keychain (link `CoreFoundation` and `Security` with `-framework`). Requires Apple Clang; GCC is not supported for this feature. | `CPPHTTPLIB_DISABLE_MACOSX_AUTOMATIC_ROOT_CERTIFICATES` |
|
||||||
| Windows | Verifies certs via CryptoAPI (`CertGetCertificateChain` / `CertVerifyCertificateChainPolicy`) with revocation checking | `CPPHTTPLIB_DISABLE_WINDOWS_AUTOMATIC_ROOT_CERTIFICATES_UPDATE` |
|
| Windows | Verifies certs via CryptoAPI (`CertGetCertificateChain` / `CertVerifyCertificateChainPolicy`) with revocation checking | `CPPHTTPLIB_DISABLE_WINDOWS_AUTOMATIC_ROOT_CERTIFICATES_UPDATE` |
|
||||||
|
|
||||||
On Windows, verification can also be disabled at runtime:
|
On Windows, verification can also be disabled at runtime:
|
||||||
|
|||||||
@@ -336,7 +336,7 @@ using socket_t = int;
|
|||||||
|
|
||||||
// On macOS with a TLS backend, enable Keychain root certificates by default
|
// On macOS with a TLS backend, enable Keychain root certificates by default
|
||||||
// unless the user explicitly opts out.
|
// unless the user explicitly opts out.
|
||||||
#if defined(__APPLE__) && \
|
#if defined(__APPLE__) && defined(__clang__) && \
|
||||||
!defined(CPPHTTPLIB_DISABLE_MACOSX_AUTOMATIC_ROOT_CERTIFICATES) && \
|
!defined(CPPHTTPLIB_DISABLE_MACOSX_AUTOMATIC_ROOT_CERTIFICATES) && \
|
||||||
(defined(CPPHTTPLIB_OPENSSL_SUPPORT) || \
|
(defined(CPPHTTPLIB_OPENSSL_SUPPORT) || \
|
||||||
defined(CPPHTTPLIB_MBEDTLS_SUPPORT) || \
|
defined(CPPHTTPLIB_MBEDTLS_SUPPORT) || \
|
||||||
@@ -355,7 +355,7 @@ using socket_t = int;
|
|||||||
|
|
||||||
#if defined(CPPHTTPLIB_USE_NON_BLOCKING_GETADDRINFO) || \
|
#if defined(CPPHTTPLIB_USE_NON_BLOCKING_GETADDRINFO) || \
|
||||||
defined(CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN)
|
defined(CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN)
|
||||||
#if TARGET_OS_MAC
|
#if TARGET_OS_MAC && defined(__clang__)
|
||||||
#include <CFNetwork/CFHost.h>
|
#include <CFNetwork/CFHost.h>
|
||||||
#include <CoreFoundation/CoreFoundation.h>
|
#include <CoreFoundation/CoreFoundation.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -5789,7 +5789,7 @@ inline int getaddrinfo_with_timeout(const char *node, const char *service,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
#elif TARGET_OS_MAC
|
#elif TARGET_OS_MAC && defined(__clang__)
|
||||||
if (!node) { return EAI_NONAME; }
|
if (!node) { return EAI_NONAME; }
|
||||||
// macOS implementation using CFHost API for asynchronous DNS resolution
|
// macOS implementation using CFHost API for asynchronous DNS resolution
|
||||||
CFStringRef hostname_ref = CFStringCreateWithCString(
|
CFStringRef hostname_ref = CFStringCreateWithCString(
|
||||||
|
|||||||
Reference in new issue
Block a user