Home | C-Bits Package Documentation | Project Page |
#include <SSLServerSocket.h>
Collaboration diagram for cbits::SSLServerSocket:
Public Methods | |
SSLServerSocket (const int port, const int qdepth=20, SSLContext *const ctxt=0) throw ( SocketException ) | |
Construct an SSL-enabled server socket. More... | |
virtual SSLSocket * | accept (const long int msec=0) throw ( SocketException ) |
Accept the next SSL connection on this server socket. More... | |
Static Public Methods | |
void | setGlobalContext (SSLContext *g_ctxt) throw ( SSLContextException ) |
Set a SSL context to be used by ALL new SSLServerSocket instances. More... | |
Private Attributes | |
BIO * | _bio |
OpenSSL BIO object wrapping the low-level BSD socket. More... | |
SSLContext * | _ctxt |
The SSL context for this SSLServerSocket. More... | |
CriticalSection | _csect |
Critical section to prevent multiple threads from invoking cbits::SSLServerSocket::accept simultaneously. More... | |
Static Private Attributes | |
SSLContext * | _global_ctxt = 0 |
The global, default SSL security context, if set. More... |
The OpenSSL library (http://www.openssl.org) is used to provide SSL-related functionality and X.509 certificate handling.
From the user's perspective, a cbits::SSLServerSocket is (in principle) identical to a cbits::ServerSocket in terms of functionality after the network connection has been established and the SSL handshake has succeeded.
However, all SSL sockets have to be created within a particular SSL context that defines parameters and data used during the SSL handshake, such as what ciphers are allowed (or not) and the location of relevant X.509 certificates.
The cbits::SSLContext class is used to represent an SSL security context for establishing SSL network connections. An instance of cbits::SSLContext should be provided to the cbits::SSLServerSocket constructor or set globally, in advance, for all (future) SSLServerSocket instances via the cbits::SSLServerSocket::setGlobalContext method.
Further, all cbits::SSLSocket connections produced from a cbits::SSLServerSocket, as a result of the SSL-enabled server accepting SSL connections from remote clients, inherit the cbits::SSLContect of the cbits::SSLServerSocket that produced them.
|
Construct an SSL-enabled server socket. port - the port to accept client connections on. Returns: ------------ n/a Exceptions: ----------- SocketException - if the socket can not be created.
|
|
Accept the next SSL connection on this server socket.
|
|
Set a SSL context to be used by ALL new SSLServerSocket instances. This may be overridden for individual SSLServerSocket instances by supplying a different context to the SSLServerSocket constructor when the SSLServerSocket is created.
|
|
OpenSSL BIO object wrapping the low-level BSD socket.
|
|
Critical section to prevent multiple threads from invoking cbits::SSLServerSocket::accept simultaneously.
|
|
The SSL context for this SSLServerSocket.
|
|
The global, default SSL security context, if set.
|
|
|