codekingpro/portable-devtools
115k
1/*-------------------------------------------------------------------------2 *3 * openssl.h4 * OpenSSL supporting functionality shared between frontend and backend5 *6 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group7 * Portions Copyright (c) 1994, Regents of the University of California8 *9 * IDENTIFICATION10 * src/include/common/openssl.h11 *12 *-------------------------------------------------------------------------13 */14#ifndef COMMON_OPENSSL_H15#define COMMON_OPENSSL_H16 17#ifdef USE_OPENSSL18#include <openssl/ssl.h>19 20/*21 * OpenSSL doesn't provide any very nice way to identify the min/max22 * protocol versions the library supports, so we fake it as best we can.23 * Note in particular that this doesn't account for restrictions that24 * might be specified in the installation's openssl.cnf.25 *26 * We disable SSLv3 and older in library setup, so TLSv1 is the oldest27 * protocol version of interest.28 */29#define MIN_OPENSSL_TLS_VERSION "TLSv1"30 31#if defined(TLS1_3_VERSION)32#define MAX_OPENSSL_TLS_VERSION "TLSv1.3"33#elif defined(TLS1_2_VERSION)34#define MAX_OPENSSL_TLS_VERSION "TLSv1.2"35#elif defined(TLS1_1_VERSION)36#define MAX_OPENSSL_TLS_VERSION "TLSv1.1"37#else38#define MAX_OPENSSL_TLS_VERSION "TLSv1"39#endif40 41/* src/common/protocol_openssl.c */42#ifndef SSL_CTX_set_min_proto_version43extern int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, int version);44extern int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, int version);45#endif46 47#endif /* USE_OPENSSL */48 49#endif /* COMMON_OPENSSL_H */50 