2023-02-08 11:04:11 +00:00
|
|
|
//
|
|
|
|
// NetSSL.h
|
|
|
|
//
|
|
|
|
// Library: NetSSL_OpenSSL
|
|
|
|
// Package: SSLCore
|
|
|
|
// Module: OpenSSL
|
|
|
|
//
|
|
|
|
// Basic definitions for the Poco OpenSSL library.
|
|
|
|
// This file must be the first file included by every other OpenSSL
|
|
|
|
// header file.
|
|
|
|
//
|
|
|
|
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
|
|
|
// and Contributors.
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef NetSSL_NetSSL_INCLUDED
|
|
|
|
#define NetSSL_NetSSL_INCLUDED
|
|
|
|
|
|
|
|
|
|
|
|
#include "Poco/Crypto/Crypto.h"
|
2023-02-13 09:22:33 +00:00
|
|
|
#include "Poco/Net/Net.h"
|
2023-02-08 11:04:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// The following block is the standard way of creating macros which make exporting
|
|
|
|
// from a DLL simpler. All files within this DLL are compiled with the NetSSL_EXPORTS
|
|
|
|
// symbol defined on the command line. this symbol should not be defined on any project
|
|
|
|
// that uses this DLL. This way any other project whose source files include this file see
|
2023-02-09 10:05:14 +00:00
|
|
|
// NetSSL_API functions as being imported from a DLL, whereas this DLL sees symbols
|
2023-02-08 11:04:11 +00:00
|
|
|
// defined with this macro as being exported.
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(NetSSL_API)
|
2023-02-13 09:22:33 +00:00
|
|
|
# if !defined(POCO_NO_GCC_API_ATTRIBUTE) && defined(__GNUC__) && (__GNUC__ >= 4)
|
|
|
|
# define NetSSL_API __attribute__((visibility("default")))
|
|
|
|
# else
|
|
|
|
# define NetSSL_API
|
|
|
|
# endif
|
2023-02-08 11:04:11 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Automatically link NetSSL and OpenSSL libraries.
|
|
|
|
//
|
|
|
|
|
|
|
|
|
2023-02-13 09:22:33 +00:00
|
|
|
namespace Poco
|
|
|
|
{
|
|
|
|
namespace Net
|
|
|
|
{
|
|
|
|
|
2023-02-08 11:04:11 +00:00
|
|
|
|
2023-02-13 09:22:33 +00:00
|
|
|
void NetSSL_API initializeSSL();
|
|
|
|
/// Initialize the NetSSL library, as well as the underlying OpenSSL
|
|
|
|
/// libraries, by calling Poco::Crypto::OpenSSLInitializer::initialize().
|
|
|
|
///
|
|
|
|
/// Should be called before using any class from the NetSSL library.
|
|
|
|
/// The NetSSL will be initialized automatically, through
|
|
|
|
/// Poco::Crypto::OpenSSLInitializer instances or similar mechanisms
|
|
|
|
/// when creating Context or SSLManager instances.
|
|
|
|
/// However, it is recommended to call initializeSSL()
|
|
|
|
/// in any case at application startup.
|
|
|
|
///
|
|
|
|
/// Can be called multiple times; however, for every call to
|
|
|
|
/// initializeSSL(), a matching call to uninitializeSSL()
|
|
|
|
/// must be performed.
|
2023-02-08 11:04:11 +00:00
|
|
|
|
|
|
|
|
2023-02-13 09:22:33 +00:00
|
|
|
void NetSSL_API uninitializeSSL();
|
|
|
|
/// Uninitializes the NetSSL library by calling
|
|
|
|
/// Poco::Crypto::OpenSSLInitializer::uninitialize() and
|
|
|
|
/// shutting down the SSLManager.
|
2023-02-08 11:04:11 +00:00
|
|
|
|
|
|
|
|
2023-02-13 09:22:33 +00:00
|
|
|
}
|
|
|
|
} // namespace Poco::Net
|
2023-02-08 11:04:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif // NetSSL_NetSSL_INCLUDED
|