#include <icy/net/sslmanager.h>Singleton that owns the default client/server TLS contexts and related callbacks.
| Return | Name | Description |
|---|---|---|
ThreadSignal< void(VerificationErrorDetails &)> | ServerVerificationError | Fired whenever a certificate verification error is detected by the server during a handshake. |
ThreadSignal< void(VerificationErrorDetails &)> | ClientVerificationError | Fired whenever a certificate verification error is detected by the client during a handshake. |
ThreadSignal< void(std::string &)> | PrivateKeyPassphraseRequired | Fired when an encrypted certificate or private key is loaded. Not setting the password in the event parameter will result in a failure to load the certificate. |
ThreadSignal< void(VerificationErrorDetails &)> ServerVerificationErrorFired whenever a certificate verification error is detected by the server during a handshake.
ThreadSignal< void(VerificationErrorDetails &)> ClientVerificationErrorFired whenever a certificate verification error is detected by the client during a handshake.
ThreadSignal< void(std::string &)> PrivateKeyPassphraseRequiredFired when an encrypted certificate or private key is loaded. Not setting the password in the event parameter will result in a failure to load the certificate.
| Return | Name | Description |
|---|---|---|
void | initializeServer | Initializes the server side of the SSLManager server-side SSLContext. |
void | initializeClient | Initializes the client side of the SSLManager with a default client-side SSLContext. |
SSLContext::Ptr | defaultServerContext | Returns the default context used by the server if initialized. |
SSLContext::Ptr | defaultClientContext | Returns the default context used by the client if initialized. |
void | shutdown | Shuts down the SSLManager and releases the default context objects. After a call to shutdown(), the SSLManager can no longer be used. |
void initializeServer(SSLContext::Ptr ptrContext)Initializes the server side of the SSLManager server-side SSLContext.
void initializeClient(SSLContext::Ptr ptrContext)Initializes the client side of the SSLManager with a default client-side SSLContext.
SSLContext::Ptr defaultServerContext()Returns the default context used by the server if initialized.
SSLContext::Ptr defaultClientContext()Returns the default context used by the client if initialized.
void shutdown()Shuts down the SSLManager and releases the default context objects. After a call to shutdown(), the SSLManager can no longer be used.
Normally, it's not necessary to call this method directly, as this will be called either by uninitializeSSL(), or when the SSLManager instance is destroyed.
| Return | Name | Description |
|---|---|---|
SSLManager & | instance static | Returns the instance of the SSLManager singleton. |
void | destroy static | Shuts down and destroys the SSLManager singleton instance. |
void | initNoVerifyClient static | Initializes a default no-verify client context that's useful for testing. |
void | initNoVerifyServer static | Initializes a default no-verify server context that's useful for testing. Optionally accepts private key and certificate file paths for server identity; if omitted, no certificate is loaded. |
static
static SSLManager & instance()Returns the instance of the SSLManager singleton.
static
static void destroy()Shuts down and destroys the SSLManager singleton instance.
static
static void initNoVerifyClient()Initializes a default no-verify client context that's useful for testing.
static
static void initNoVerifyServer(const std::string & privateKeyFile, const std::string & certificateFile)Initializes a default no-verify server context that's useful for testing. Optionally accepts private key and certificate file paths for server identity; if omitted, no certificate is loaded.
| Return | Name | Description |
|---|---|---|
SSLContext::Ptr | _defaultServerContext | |
SSLContext::Ptr | _defaultClientContext | |
std::mutex | _mutex |
SSLContext::Ptr _defaultServerContextSSLContext::Ptr _defaultClientContextstd::mutex _mutex| Return | Name | Description |
|---|---|---|
SSLManager | Creates the SSLManager. | |
~SSLManager | Destroys the SSLManager. | |
SSLManager | Deleted constructor. | |
SSLManager | Deleted constructor. |
SSLManager()Creates the SSLManager.
~SSLManager() noexceptDestroys the SSLManager.
SSLManager(const SSLManager &) = deleteDeleted constructor.
SSLManager(SSLManager &&) = deleteDeleted constructor.
| Return | Name | Description |
|---|---|---|
int | verifyCallback static | The return value of this method defines how errors in verification are handled. Return 0 to terminate the handshake, or 1 to continue despite the error. |
static
static int verifyCallback(bool server, int ok, X509_STORE_CTX * pStore)The return value of this method defines how errors in verification are handled. Return 0 to terminate the handshake, or 1 to continue despite the error.