libepp_nicbr
Public Member Functions | List of all members
TransportTLS Class Reference

TransportTLS class. More...

#include <TransportTLS.H>

Inheritance diagram for TransportTLS:
TransportTLSCommon

Public Member Functions

 TransportTLS (const string &server="localhost", const int &port=700)
 Default constructor.
 
string get_server () const
 Return the server address. More...
 
int get_port () const
 Return the server port number. More...
 
void set_server (const string &server)
 Set the server name/address. More...
 
void set_port (const int port)
 Set connection port. More...
 
void connect (const string &client_cert_file, const string &root_ca_file, const string &pem_passphrase="")
 Open the Connection. More...
 
- Public Member Functions inherited from TransportTLSCommon
 TransportTLSCommon ()
 Constructor.
 
 ~TransportTLSCommon ()
 Destructor.
 
void read (string &xml_payload, const int &timeout=TIMEOUT)
 Read payload from the open connection. More...
 
void write (const string &xml_payload, const int &timeout=TIMEOUT)
 Write payload to the open connection. More...
 
void disconnect ()
 Close the connection.
 
string get_openssl_msg () const
 Return the OpenSSL error message. More...
 
long cert_common_name_check (const string &common_name)
 Checks if peer's certificate common name matches string common_name. More...
 
void enable_cert_common_name_check ()
 Enables peer's certificate common name check.
 
void disable_cert_common_name_check ()
 Disables peer's certificate common name check.
 

Additional Inherited Members

- Protected Member Functions inherited from TransportTLSCommon
void seed_prng ()
 Seed OpenSSL pseudo random number generator.
 
void setup_context (const string &cert_file, const string &root_ca_file, const string &pem_passphrase="")
 Setup Context for Certificate Validation. More...
 
void set_non_blocking ()
 Set the underlying I/O descriptor as non-blocking.
 
- Static Protected Member Functions inherited from TransportTLSCommon
static int pem_passwd_cb (char *buf, int size, int rwflag, void *userdata)
 Callback method used by OpenSSL to collect passphrases. More...
 
- Protected Attributes inherited from TransportTLSCommon
BIO * _conn
 BIO Socket.
 
SSL_CTX * _ssl_ctx
 SSL Context.
 
SSL * _ssl
 SSL object.
 
bool _cert_common_name_check_enabled
 Flag for peer's certificate CN check.
 
- Static Protected Attributes inherited from TransportTLSCommon
static string _pem_passphrase
 pem passphrase
 
static const int TIMEOUT
 Default read/write timeout in seconds.
 

Detailed Description

TransportTLS class.

Member Function Documentation

void TransportTLS::connect ( const string &  client_cert_file,
const string &  root_ca_file,
const string &  pem_passphrase = "" 
)

Open the Connection.

Parameters
client_cert_fileClient certificate file
root_ca_fileRoot certificate file
pem_passphraseOptional passphrase for an encrypted private key
int TransportTLS::get_port ( ) const

Return the server port number.

Returns
server port number
string TransportTLS::get_server ( ) const

Return the server address.

Returns
server name/address
void TransportTLS::set_port ( const int  port)

Set connection port.

Parameters
portserver port number
void TransportTLS::set_server ( const string &  server)

Set the server name/address.

Parameters
servername/address

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