SSLManager
SSLManager
#include <icy/net/sslmanager.h>class SSLManagerDefined in src/net/include/icy/net/sslmanager.h:31
Singleton that owns the default client/server TLS contexts and related callbacks.
List of all members
| Name | Kind | Owner |
|---|---|---|
Singleton< SSLManager > | friend | Declared here |
SSLContext | friend | Declared here |
ServerVerificationError | variable | Declared here |
ClientVerificationError | variable | Declared here |
PrivateKeyPassphraseRequired | variable | Declared here |
initializeServer | function | Declared here |
initializeClient | function | Declared here |
defaultServerContext | function | Declared here |
defaultClientContext | function | Declared here |
shutdown | function | Declared here |
instance | function | Declared here |
destroy | function | Declared here |
initNoVerifyClient | function | Declared here |
initNoVerifyServer | function | Declared here |
_defaultServerContext | variable | Declared here |
_defaultClientContext | variable | Declared here |
_mutex | variable | Declared here |
SSLManager | function | Declared here |
~SSLManager | function | Declared here |
SSLManager | function | Declared here |
operator= | function | Declared here |
SSLManager | function | Declared here |
operator= | function | Declared here |
verifyCallback | function | Declared here |
Friends
| Name | Description |
|---|---|
Singleton< SSLManager > | |
SSLContext |
Singleton< SSLManager >
friend class Singleton< SSLManager >Defined in src/net/include/icy/net/sslmanager.h:122
SSLContext
friend class SSLContextDefined in src/net/include/icy/net/sslmanager.h:125
Public Attributes
| 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. |
ServerVerificationError
ThreadSignal< void(VerificationErrorDetails &)> ServerVerificationErrorDefined in src/net/include/icy/net/sslmanager.h:49
Fired whenever a certificate verification error is detected by the server during a handshake.
ClientVerificationError
ThreadSignal< void(VerificationErrorDetails &)> ClientVerificationErrorDefined in src/net/include/icy/net/sslmanager.h:53
Fired whenever a certificate verification error is detected by the client during a handshake.
PrivateKeyPassphraseRequired
ThreadSignal< void(std::string &)> PrivateKeyPassphraseRequiredDefined in src/net/include/icy/net/sslmanager.h:57
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.
Public Methods
| 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. |
initializeServer
void initializeServer(SSLContext::Ptr ptrContext)Defined in src/net/include/icy/net/sslmanager.h:35
Initializes the server side of the SSLManager server-side SSLContext.
initializeClient
void initializeClient(SSLContext::Ptr ptrContext)Defined in src/net/include/icy/net/sslmanager.h:39
Initializes the client side of the SSLManager with a default client-side SSLContext.
defaultServerContext
SSLContext::Ptr defaultServerContext()Defined in src/net/include/icy/net/sslmanager.h:42
Returns the default context used by the server if initialized.
defaultClientContext
SSLContext::Ptr defaultClientContext()Defined in src/net/include/icy/net/sslmanager.h:45
Returns the default context used by the client if initialized.
shutdown
void shutdown()Defined in src/net/include/icy/net/sslmanager.h:66
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.
Public Static Methods
| 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. |
instance
static
static SSLManager & instance()Defined in src/net/include/icy/net/sslmanager.h:69
Returns the instance of the SSLManager singleton.
destroy
static
static void destroy()Defined in src/net/include/icy/net/sslmanager.h:72
Shuts down and destroys the SSLManager singleton instance.
initNoVerifyClient
static
static void initNoVerifyClient()Defined in src/net/include/icy/net/sslmanager.h:76
Initializes a default no-verify client context that's useful for testing.
initNoVerifyServer
static
static void initNoVerifyServer(const std::string & privateKeyFile = "", const std::string & certificateFile = "")Defined in src/net/include/icy/net/sslmanager.h:81
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.
Private Attributes
| Return | Name | Description |
|---|---|---|
SSLContext::Ptr | _defaultServerContext | |
SSLContext::Ptr | _defaultClientContext | |
std::mutex | _mutex |
_defaultServerContext
SSLContext::Ptr _defaultServerContextDefined in src/net/include/icy/net/sslmanager.h:120
_defaultClientContext
SSLContext::Ptr _defaultClientContextDefined in src/net/include/icy/net/sslmanager.h:121
_mutex
std::mutex _mutexDefined in src/net/include/icy/net/sslmanager.h:122
Private Methods
| Return | Name | Description |
|---|---|---|
SSLManager | Creates the SSLManager. | |
~SSLManager noexcept | Destroys the SSLManager. | |
SSLManager | Deleted constructor. | |
SSLManager | Deleted constructor. |
SSLManager
SSLManager()Defined in src/net/include/icy/net/sslmanager.h:105
Creates the SSLManager.
~SSLManager
noexcept
~SSLManager() noexceptDefined in src/net/include/icy/net/sslmanager.h:108
Destroys the SSLManager.
SSLManager
SSLManager(const SSLManager &) = deleteDefined in src/net/include/icy/net/sslmanager.h:110
Deleted constructor.
SSLManager
SSLManager(SSLManager &&) = deleteDefined in src/net/include/icy/net/sslmanager.h:112
Deleted constructor.
Private Static Methods
| 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. |
verifyCallback
static
static int verifyCallback(bool server, int ok, X509_STORE_CTX * pStore)Defined in src/net/include/icy/net/sslmanager.h:118
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.
