|
dodo
0.0.1
A C++ library to create containerized Linux services
|
Go to the documentation of this file.
23 #ifndef network_tlssocket_hpp
24 #define network_tlssocket_hpp
26 #include <openssl/ssl.h>
128 if (
ssl_ )
return SSL_version(
ssl_ );
else return 0;
137 if (
ssl_ )
return SSL_get_version(
ssl_ );
else return "?";
146 if (
ssl_ )
return SSL_get_cipher_name(
ssl_ );
else return "?";
SSL * ssl_
The SSL object.
bool operator==(const TLSSocket &socket) const
Identity.
X509Common::SAN peer_name_
The peer name connected to, for TLS CN and SubjectAltName matching.
std::string getTLSProtocolVersionString() const
Return the negotiated TLS (SSL) protocol version.
Generic network Address, supporting ipv4 and ipv6 transparently.
virtual common::SystemError send(const void *buf, ssize_t len, bool more=false)
Send data.
TLSContext & tlscontext_
The TLSContext.
virtual common::SystemError connect(const Address &address)
Connect to the Address.
virtual common::SystemError receive(void *buf, ssize_t request, ssize_t &received)
Receive data.
Socket for TLS encrypted traffic between trusted endpoints.
Socket parameters - the family (domain), socket type and protocol triplet.
std::string getTLSCurrentCipherName() const
Return the negotiated cipher name.
int socket_
The socket file decsriptor.
Interface for network communication.
TLSSocket(int socket, TLSContext &tlscontext, const X509Common::SAN &peer_name)
Construct from existing socket file descriptor.
int getTLSProtocolVersion() const
return the negotiated TLS (SSL) protocol version.
virtual ~TLSSocket()
Destructor.
virtual TLSSocket * accept()
Accept a connection.
Linux system error primitive to provide a consistent interface to Linux error codes.
bool operator<(const TLSSocket &socket) const
Ordering.
X509 * getPeerCertificate() const
Get the peer's certificate.
Interface to and common implementation of concrete sockets (Socket, TLSSocket).