Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
Config.h
1// Copyright (c) ZeroC, Inc.
2
3#ifndef ICE_SSL_CONFIG
4#define ICE_SSL_CONFIG
5
6#if defined(_WIN32)
7# define ICE_USE_SCHANNEL
8// We need to include windows.h before wincrypt.h.
9// clang-format off
10# ifndef NOMINMAX
11# define NOMINMAX
12# endif
13# include <windows.h>
14# include <wincrypt.h>
15// clang-format on
16
17// SECURITY_WIN32 or SECURITY_KERNEL are defined before including security.h indicating who is compiling the code.
18# ifdef SECURITY_WIN32
19# undef SECURITY_WIN32
20# endif
21# ifdef SECURITY_KERNEL
22# undef SECURITY_KERNEL
23# endif
24# define SECURITY_WIN32 1
25
26// See SCH_CREDENTIALS requirements:
27// https://learn.microsoft.com/en-us/windows/win32/api/schannel/ns-schannel-sch_credentials#remarks
28# ifndef SCHANNEL_USE_BLACKLISTS
29# define SCHANNEL_USE_BLACKLISTS 1
30# endif
31# include <SubAuth.h>
32
33# include <schannel.h>
34# include <security.h>
35# include <sspi.h>
36# undef SECURITY_WIN32
37#elif defined(__APPLE__)
38# include <TargetConditionals.h>
39# define ICE_USE_SECURE_TRANSPORT
40# if TARGET_OS_IPHONE != 0
41# define ICE_USE_SECURE_TRANSPORT_IOS 1
42# else
43# define ICE_USE_SECURE_TRANSPORT_MACOS 1
44# endif
45# include <Security/SecureTransport.h>
46# include <Security/Security.h>
47#else
48# define ICE_USE_OPENSSL
49# include <openssl/err.h>
50# include <openssl/ssl.h>
51# include <openssl/x509v3.h>
52#endif
53
54#endif