Add a TLS security layer to an existing socket. More...


Public Member Functions | |
| ~TLSSocket () | |
| void | handshake (ref< timeoutHandler > toHandler=NULL) |
| ref < security::cert::certificateChain > | getPeerCertificates () const |
| void | connect (const string &address, const port_t port) |
| void | disconnect () |
| bool | isConnected () const |
| void | receive (string &buffer) |
| size_type | receiveRaw (char *buffer, const size_type count) |
| void | send (const string &buffer) |
| void | sendRaw (const char *buffer, const size_type count) |
| size_type | getBlockSize () const |
Protected Member Functions | |
| TLSSocket (ref< TLSSession > session, ref< socket > sok) | |
Add a TLS security layer to an existing socket.
| TLSSocket | ( | ref< TLSSession > | session, | |
| ref< socket > | sok | |||
| ) | [protected] |
Create a new socket object that adds a security layer around an existing socket.
| session | TLS session | |
| sok | socket to wrap |
| ~TLSSocket | ( | ) |
Connect to the specified address and port.
| address | server address (this can be a full qualified domain name or an IP address, doesn't matter) | |
| port | server port |
Implements socket.
| void disconnect | ( | ) | [virtual] |
Disconnect from the server.
Implements socket.
| TLSSocket::size_type getBlockSize | ( | ) | const [virtual] |
Return the preferred maximum block size when reading from or writing to this stream.
Implements socket.
| ref< security::cert::certificateChain > getPeerCertificates | ( | ) | const |
Return the peer's certificate (chain) as sent by the peer.
| void handshake | ( | ref< timeoutHandler > | toHandler = NULL |
) |
Starts a TLS handshake on this connection.
| exceptions::tls_exception | if a fatal error occurs during the negociation process, exceptions::operation_timed_out if a time-out occurs |
| bool isConnected | ( | ) | const [virtual] |
Test whether this socket is connected.
Implements socket.
| void receive | ( | string & | buffer | ) | [virtual] |
Receive (text) data from the socket.
| buffer | buffer in which to write received data |
Implements socket.
| TLSSocket::size_type receiveRaw | ( | char * | buffer, | |
| const size_type | count | |||
| ) | [virtual] |
Receive (raw) data from the socket.
| buffer | buffer in which to write received data | |
| count | maximum number of bytes to receive (size of buffer) |
Implements socket.
| void send | ( | const string & | buffer | ) | [virtual] |
| void sendRaw | ( | const char * | buffer, | |
| const size_type | count | |||
| ) | [virtual] |
Send (raw) data to the socket.
| buffer | data to send | |
| count | number of bytes to send (size of buffer) |
Implements socket.
1.6.2