CPPMyth
Library to interoperate with MythTV server
Loading...
Searching...
No Matches
NSROOT::SSLServerContext Class Reference

Public Member Functions

bool InitContext (const std::string &certfile, const std::string &pkeyfile)
SecureSocketNewServerSocket ()

Static Public Member Functions

static TcpServerSocket::AcceptStatus SSLHandshake (SecureSocket &socket)

Private Member Functions

 SSLServerContext (const SSLServerContext &other)
SSLServerContext & operator= (const SSLServerContext &other)

Private Attributes

void * m_server_ctx
 SSL server context.

Detailed Description

Definition at line 58 of file securesocket.h.

Constructor & Destructor Documentation

◆ SSLServerContext()

NSROOT::SSLServerContext::SSLServerContext ( )
inline

Definition at line 61 of file securesocket.h.

◆ ~SSLServerContext()

SSLServerContext::~SSLServerContext ( )

Definition at line 470 of file securesocket.cpp.

Member Function Documentation

◆ InitContext()

bool SSLServerContext::InitContext ( const std::string & certfile,
const std::string & pkeyfile )

Initialize the server context with the given identity. The certificate and key must match for the operation to succeed.

Parameters
certfilethe string path of the certificate file (pem)
pkeyfilethe string path of the private key file (pem)
Returns
true on success, else false

Definition at line 474 of file securesocket.cpp.

◆ NewServerSocket()

SecureSocket * SSLServerContext::NewServerSocket ( )

Create a new server socket with this context. Ownership of the returned pointer is transferred to the caller.

Returns
new pointer to socket or nullptr on failure

Definition at line 479 of file securesocket.cpp.

◆ SSLHandshake()

TcpServerSocket::AcceptStatus SSLServerContext::SSLHandshake ( SecureSocket & socket)
static

Process SSL handshake for a new accepted connection.

sock = SSLServerContext::NewServerSocket(); if (TcpServerSocket::AcceptConnection(*sock, tm) == ACCEPT_SUCCESS && SSLServerContext::SSLHandshake(*sock) == ACCEPT_SUCCESS) { // continue } delete sock;

Parameters
socketthe accepted connection
Returns
AcceptStatus

Definition at line 484 of file securesocket.cpp.

Field Documentation

◆ m_server_ctx

void* NSROOT::SSLServerContext::m_server_ctx
private

SSL server context.

Definition at line 99 of file securesocket.h.


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