MySQL 8.3.0
Source Code Documentation
DestinationTlsContext Class Reference

TlsClientContext per destination. More...

#include <destination_ssl_context.h>

Public Member Functions

 DestinationTlsContext (bool session_cache_mode, size_t ssl_session_cache_size, unsigned int ssl_session_cache_timeout)
 
void verify (SslVerify ssl_verify)
 set SslVerify. More...
 
void ca_file (const std::string &file)
 set CA file. More...
 
void ca_path (const std::string &path)
 set CA path. More...
 
void crl_file (const std::string &file)
 set CRL file. More...
 
void crl_path (const std::string &path)
 set CRL path. More...
 
void curves (const std::string &curves)
 set allowed EC curves. More...
 
void ciphers (const std::string &ciphers)
 set allowed ciphers. More...
 
void client_key_and_cert_file (std::string key, std::string cert)
 set client-key and its cert. More...
 
TlsClientContextget (const std::string &dest_id, const std::string &hostname)
 get a TlsClientContent for a destination. More...
 

Private Attributes

SslVerify ssl_verify_ {SslVerify::kDisabled}
 
std::string ca_file_
 
std::string ca_path_
 
std::string crl_file_
 
std::string crl_path_
 
std::string curves_
 
std::string ciphers_
 
std::string cert_file_
 
std::string key_file_
 
std::map< std::string, std::unique_ptr< TlsClientContext > > tls_contexts_
 
std::mutex mtx_
 
bool session_cache_mode_ {true}
 
size_t ssl_session_cache_size_ {}
 
std::chrono::seconds ssl_session_cache_timeout_ {std::chrono::seconds(0)}
 

Detailed Description

TlsClientContext per destination.

Constructor & Destructor Documentation

◆ DestinationTlsContext()

DestinationTlsContext::DestinationTlsContext ( bool  session_cache_mode,
size_t  ssl_session_cache_size,
unsigned int  ssl_session_cache_timeout 
)
inline

Member Function Documentation

◆ ca_file()

void DestinationTlsContext::ca_file ( const std::string &  file)

set CA file.

◆ ca_path()

void DestinationTlsContext::ca_path ( const std::string &  path)

set CA path.

◆ ciphers()

void DestinationTlsContext::ciphers ( const std::string &  ciphers)

set allowed ciphers.

◆ client_key_and_cert_file()

void DestinationTlsContext::client_key_and_cert_file ( std::string  key,
std::string  cert 
)

set client-key and its cert.

◆ crl_file()

void DestinationTlsContext::crl_file ( const std::string &  file)

set CRL file.

◆ crl_path()

void DestinationTlsContext::crl_path ( const std::string &  path)

set CRL path.

◆ curves()

void DestinationTlsContext::curves ( const std::string &  curves)

set allowed EC curves.

◆ get()

TlsClientContext * DestinationTlsContext::get ( const std::string &  dest_id,
const std::string &  hostname 
)

get a TlsClientContent for a destination.

If no TlsClientContext exists for the destination, creates a TlsClientContent based on:

  • verify()
  • ca_file()
  • ca_path()
  • crl_file()
  • crl_path()
  • curves()
  • ciphers()

If that succeeds, it the resulting TlsClientContext is cached and a pointer to it is returned.

If a TlsClientContext for the destination exists, a pointer to it is returned.

Parameters
dest_idunique identifier of a destination
hostnamename of the destination host

◆ verify()

void DestinationTlsContext::verify ( SslVerify  ssl_verify)

set SslVerify.

Member Data Documentation

◆ ca_file_

std::string DestinationTlsContext::ca_file_
private

◆ ca_path_

std::string DestinationTlsContext::ca_path_
private

◆ cert_file_

std::string DestinationTlsContext::cert_file_
private

◆ ciphers_

std::string DestinationTlsContext::ciphers_
private

◆ crl_file_

std::string DestinationTlsContext::crl_file_
private

◆ crl_path_

std::string DestinationTlsContext::crl_path_
private

◆ curves_

std::string DestinationTlsContext::curves_
private

◆ key_file_

std::string DestinationTlsContext::key_file_
private

◆ mtx_

std::mutex DestinationTlsContext::mtx_
private

◆ session_cache_mode_

bool DestinationTlsContext::session_cache_mode_ {true}
private

◆ ssl_session_cache_size_

size_t DestinationTlsContext::ssl_session_cache_size_ {}
private

◆ ssl_session_cache_timeout_

std::chrono::seconds DestinationTlsContext::ssl_session_cache_timeout_ {std::chrono::seconds(0)}
private

◆ ssl_verify_

SslVerify DestinationTlsContext::ssl_verify_ {SslVerify::kDisabled}
private

◆ tls_contexts_

std::map<std::string, std::unique_ptr<TlsClientContext> > DestinationTlsContext::tls_contexts_
private

The documentation for this class was generated from the following files: