4 #include "mbedtls/ssl.h"
36 using cDebugCallback = void(*)(
void *, int,
const char *, int,
const char *);
std::shared_ptr< cCryptoKey > cCryptoKeyPtr
std::shared_ptr< cCtrDrbgContext > cCtrDrbgContextPtr
std::shared_ptr< cX509Cert > cX509CertPtr
int(*)(void *, mbedtls_x509_crt *, int, uint32_t *) cVerifyCallback
Type of the SSL certificate verify callback.
std::vector< int > m_CipherSuites
void(*)(void *, int, const char *, int, const char *) cDebugCallback
Type of the SSL debug callback.
void SetRng(cCtrDrbgContextPtr a_CtrDrbg)
Set the random number generator.
static std::shared_ptr< cSslConfig > MakeDefaultConfig(bool a_IsClient)
Creates a new config with some sensible defaults on top of mbedTLS basic settings.
void SetCipherSuites(std::vector< int > a_CipherSuites)
Set the enabled cipher suites.
void SetOwnCert(cX509CertPtr a_OwnCert, cCryptoKeyPtr a_OwnCertPrivKey)
Set the certificate to use for connections.
int InitDefaults(bool a_IsClient)
Initialize with mbedTLS default settings.
static std::shared_ptr< const cSslConfig > GetDefaultServerConfig()
Returns the default config for server connections.
mbedtls_ssl_config m_Config
void SetVerifyCallback(cVerifyCallback a_CallbackFun, void *a_CallbackData)
Set the certificate verify callback.
cCryptoKeyPtr m_OwnCertPrivKey
void SetAuthMode(eSslAuthMode a_AuthMode)
Set the authorization mode.
static std::shared_ptr< const cSslConfig > GetDefaultClientConfig()
Returns the default config for client connections.
void SetDebugCallback(cDebugCallback a_CallbackFun, void *a_CallbackData)
Set the debug callback.
void SetCACerts(cX509CertPtr a_CACert)
Set the trusted certificate authority chain.
const mbedtls_ssl_config * GetInternal() const
Returns a pointer to the wrapped mbedtls representation.
cCtrDrbgContextPtr m_CtrDrbg