Owns an OpenSSL SSL_CTX and optional log callback.
More...
#include <ssl.hpp>
|
| static TSslContext | Client (const std::function< void(const char *)> &logFunc={}) |
| | Creates a TLS client context (no certificate required).
|
| |
| static TSslContext | Server (const char *certfile, const char *keyfile, const std::function< void(const char *)> &logFunc={}) |
| | Creates a TLS server context from PEM files on disk.
|
| |
| static TSslContext | ServerFromMem (const void *certfile, const void *keyfile, const std::function< void(const char *)> &logFunc={}) |
| | Creates a TLS server context from PEM data already in memory.
|
| |
|
|
SSL_CTX * | Ctx |
| | The underlying OpenSSL context.
|
| |
|
std::function< void(const char *)> | LogFunc = {} |
| | Optional logging callback.
|
| |
Owns an OpenSSL SSL_CTX and optional log callback.
Move-only. Create via the static factory methods, then pass a reference to TSslSocket. The context must outlive every TSslSocket that uses it.
Owns an OpenSSL SSL_CTX and optional log callback.
Definition ssl.hpp:39
static TSslContext ServerFromMem(const void *certfile, const void *keyfile, const std::function< void(const char *)> &logFunc={})
Creates a TLS server context from PEM data already in memory.
Definition ssl.cpp:53
static TSslContext Client(const std::function< void(const char *)> &logFunc={})
Creates a TLS client context (no certificate required).
Definition ssl.cpp:24
static TSslContext Server(const char *certfile, const char *keyfile, const std::function< void(const char *)> &logFunc={})
Creates a TLS server context from PEM files on disk.
Definition ssl.cpp:32
◆ Client()
| TSslContext NNet::TSslContext::Client |
( |
const std::function< void(const char *)> & |
logFunc = {} | ) |
|
|
static |
Creates a TLS client context (no certificate required).
- Parameters
-
| logFunc | Optional callback for SSL state-change messages. |
◆ Server()
| TSslContext NNet::TSslContext::Server |
( |
const char * |
certfile, |
|
|
const char * |
keyfile, |
|
|
const std::function< void(const char *)> & |
logFunc = {} |
|
) |
| |
|
static |
Creates a TLS server context from PEM files on disk.
- Parameters
-
| certfile | Path to the PEM certificate file (or chain). |
| keyfile | Path to the PEM private key file. |
| logFunc | Optional callback for SSL state-change messages. |
◆ ServerFromMem()
| TSslContext NNet::TSslContext::ServerFromMem |
( |
const void * |
certfile, |
|
|
const void * |
keyfile, |
|
|
const std::function< void(const char *)> & |
logFunc = {} |
|
) |
| |
|
static |
Creates a TLS server context from PEM data already in memory.
Both certfile and keyfile must point to null-terminated PEM strings.
- Parameters
-
| certfile | PEM certificate (or chain) in memory. |
| keyfile | PEM private key in memory. |
| logFunc | Optional callback for SSL state-change messages. |
The documentation for this struct was generated from the following files: