|
join 1.0
lightweight network framework library
|
TLS stream class. More...
#include <socketstream.hpp>


Public Types | |
| using | SocketStreambuf = BasicSocketStreambuf <Protocol> |
| using | Endpoint = typename Protocol::Endpoint |
| using | Socket = typename Protocol::Socket |
Public Types inherited from join::BasicSocketStream< Protocol > | |
| using | SocketStreambuf = BasicSocketStreambuf <Protocol> |
| using | Endpoint = typename Protocol::Endpoint |
| using | Socket = typename Protocol::Socket |
Public Member Functions | |
| BasicTlsStream () | |
| default constructor. | |
| BasicTlsStream (const BasicTlsStream &other)=delete | |
| copy constructor. | |
| BasicTlsStream & | operator= (const BasicTlsStream &other)=delete |
| copy assignment operator. | |
| BasicTlsStream (BasicTlsStream &&other) | |
| move constructor. | |
| BasicTlsStream & | operator= (BasicTlsStream &&other) |
| move assignment operator. | |
| virtual | ~BasicTlsStream ()=default |
| destroy the TLS stream instance. | |
| void | startEncryption () |
| start socket encryption (perform TLS handshake). | |
| void | connectEncrypted (const Endpoint &endpoint) |
| make an encrypted connection to the given endpoint. | |
| int | setCertificate (const std::string &cert, const std::string &key="") |
| set the certificate and the private key. | |
| int | setCaPath (const std::string &caPath) |
| set the location of the trusted CA certificates. | |
| int | setCaFile (const std::string &caFile) |
| set the location of the trusted CA certificate file. | |
| void | setVerify (bool verify, int depth=-1) |
| Enable/Disable the verification of the peer certificate. | |
| int | setCipher (const std::string &cipher) |
| set the cipher list (TLSv1.2 and below). | |
| int | setCipher_1_3 (const std::string &cipher) |
| set the cipher list (TLSv1.3). | |
Public Member Functions inherited from join::BasicSocketStream< Protocol > | |
| BasicSocketStream () | |
| default constructor. | |
| BasicSocketStream (const BasicSocketStream &other)=delete | |
| copy constructor. | |
| BasicSocketStream & | operator= (const BasicSocketStream &other)=delete |
| copy assignment operator. | |
| BasicSocketStream (BasicSocketStream &&other) | |
| move constructor. | |
| BasicSocketStream & | operator= (BasicSocketStream &&other) |
| move assignment operator. | |
| virtual | ~BasicSocketStream ()=default |
| destroy the socket stream instance. | |
| virtual void | bind (const Endpoint &endpoint) |
| assigns the specified endpoint to the socket. | |
| virtual void | connect (const Endpoint &endpoint) |
| make a connection to the given endpoint. | |
| virtual void | disconnect () |
| shutdown the connection. | |
| virtual void | close () |
| close the connection. | |
| Endpoint | localEndpoint () |
| determine the local endpoint associated with this socket. | |
| const Endpoint & | remoteEndpoint () |
| determine the remote endpoint associated with this socket. | |
| bool | opened () |
| check if the socket is opened. | |
| bool | connected () |
| check if the socket is connected. | |
| bool | encrypted () |
| check if the socket is secure. | |
| void | timeout (int ms) |
| set the socket timeout. | |
| int | timeout () const |
| get the current timeout in milliseconds. | |
| Socket & | socket () |
| get the nested socket. | |
Additional Inherited Members | |
Protected Attributes inherited from join::BasicSocketStream< Protocol > | |
| SocketStreambuf | _sockbuf |
| associated stream buffer. | |
TLS stream class.
| using join::BasicTlsStream< Protocol >::Endpoint = typename Protocol::Endpoint |
| using join::BasicTlsStream< Protocol >::Socket = typename Protocol::Socket |
| using join::BasicTlsStream< Protocol >::SocketStreambuf = BasicSocketStreambuf <Protocol> |
|
inline |
default constructor.
|
delete |
copy constructor.
| other | other object to copy. |
|
inline |
move constructor.
| other | other object to move. |
|
virtualdefault |
destroy the TLS stream instance.
|
inline |
make an encrypted connection to the given endpoint.
| endpoint | endpoint to connect to. |
| std::ios_base::failure. |
|
inline |
move assignment operator.
| other | other object to assign. |
|
delete |
copy assignment operator.
| other | other object to assign. |
|
inline |
set the location of the trusted CA certificate file.
| caFile | path of the trusted CA certificate file. |
|
inline |
set the location of the trusted CA certificates.
| caPath | path of the trusted CA certificates. |
|
inline |
set the certificate and the private key.
| cert | certificate path. |
| key | private key path. |
|
inline |
set the cipher list (TLSv1.2 and below).
| cipher | the cipher list. |
|
inline |
set the cipher list (TLSv1.3).
| cipher | the cipher list. |
|
inline |
Enable/Disable the verification of the peer certificate.
| verify | Enable peer verification if set to true, false otherwise. |
| depth | The maximum certificate verification depth (default: no limit). |
|
inline |
start socket encryption (perform TLS handshake).