OpenVPN 3 Core Library
Loading...
Searching...
No Matches
sslchoose.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12#ifndef OPENVPN_SSL_SSLCHOOSE_H
13#define OPENVPN_SSL_SSLCHOOSE_H
14
17
18#ifdef USE_OPENSSL
21#endif
22
23#ifdef USE_APPLE_SSL
26#endif
27
28#ifdef USE_MBEDTLS
29#include <mbedtls/platform.h>
30#include <mbedtls/debug.h> // for debug_set_threshold
34#endif
35
36#ifdef USE_MBEDTLS_APPLE_HYBRID
39#endif
40
41namespace openvpn::SSLLib {
42#if defined(USE_MBEDTLS)
43#define SSL_LIB_NAME "MbedTLS"
44typedef MbedTLSContext SSLAPI;
45typedef MbedTLSPEM PEMAPI;
46#elif defined(USE_MBEDTLS_APPLE_HYBRID)
47// Uses Apple framework for CryptoAPI and MbedTLS for SSLAPI and RandomAPI
48#define SSL_LIB_NAME "MbedTLSAppleHybrid"
49typedef AppleCryptoAPI CryptoAPI;
50typedef MbedTLSContext SSLAPI;
51#elif defined(USE_APPLE_SSL)
52#define SSL_LIB_NAME "AppleSSL"
53typedef AppleCryptoAPI CryptoAPI;
54typedef AppleSSLContext SSLAPI;
55#elif defined(USE_OPENSSL)
56#define SSL_LIB_NAME "OpenSSL"
57typedef OpenSSLCryptoAPI CryptoAPI;
58typedef OpenSSLContext SSLAPI;
59typedef OpenSSLPEM PEMAPI;
60#else
61#error no SSL library defined
62#endif
63} // namespace openvpn::SSLLib
64
65#endif