|
OpenTop 1.5 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||||
| SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD | |||||||
#include "ot/ssl/SSLServerSocket.h"

try
{
RefPtr<SSLServerSocketFactory> rpSocketFactory = SSLServerSocketFactory::GetDefault();
RefPtr<ServerSocket> rpServerSocket = rpSocketFactory->createServerSocket(port);
//
// In this case we want to configure our SSLServerSocket
// to require clients to provide us with a certificate, and we will reject
// the SSL/TLS connection if the certificate cannot be validated
//
static_cast<SSLServerSocket*>(rpServerSocket.get())->setNeedClientAuth(true);
while(true)
{
RefPtr<Socket> rpClientSocket = rpServerSocket->accept();
// do something with the client connection...
}
}
catch(Exception& e)
{
...
}
| Constructor/Destructor Summary | |
SSLServerSocket()Protected constructor for use by SSL security providers. | |
SSLServerSocket(int port)Protected constructor for use by SSL security providers. | |
SSLServerSocket(int port, int backlog)Protected constructor for use by SSL security providers. | |
SSLServerSocket(int port, int backlog, InetAddress* pBindAddr)Protected constructor for use by SSL security providers. | |
~SSLServerSocket()virtual Destructor. | |
| Method Summary | |
virtual size_t |
getEnabledCipherSuites(StringList& ret) const=0Returns an ordered list of cipher suite names which are currently enabled for this SSLServerSocket. |
virtual bool |
getNeedClientAuth() const=0Returns a boolean flag indicating if client authentication is required during SSL handshaking. |
virtual size_t |
getSupportedCipherSuites(StringList& ret) const=0Returns an ordered list of cipher suite names which the security provider supports. |
virtual bool |
getUseClientMode() const=0Returns a boolean flag indicating if new connections should use SSL client mode during the initial SSL handshake. |
virtual bool |
getWantClientAuth() const=0Returns a boolean flag indicating if new server mode connections will request the client to authenticate itself (by sending a certificate) during the SSL handshake. |
virtual void |
setEnabledCipherSuites(const StringList& suites)=0Specifies the permitted cipher suites which may be used to negotiate new SSL connections. |
virtual void |
setNeedClientAuth(bool bSet)=0Specifies whether client authentication is required during the negotiation of new SSL connections. |
virtual void |
setUseClientMode(bool bClient)=0Controls whether SSL client or server mode will be used during the negotiation of new SSL connections. |
virtual void |
setWantClientAuth(bool bWantAuth)=0Specifies whether client authentication is requested during the negotiation of new SSL connections. |
| Methods inherited from class ot::ManagedObject |
addRef(), getRefCount(), onFinalRelease(), operator=(const ManagedObject&), release() |
| Methods inherited from class ot::net::ServerSocket |
accept(), bind(int, int, InetAddress*), bind(int, int), bind(int), close(), getInetAddress(), getLocalPort(), getReceiveBufferSize(), getReuseAddress(), getSocketDescriptor(), GetSocketImplFactory(), getSoTimeout(), implAccept(Socket*), isBound(), setReceiveBufferSize(size_t), setReuseAddress(bool), SetSocketImplFactory(SocketImplFactory*), setSoTimeout(size_t), toString() |
| Typedefs |
typedef std::list< String > StringList
| Constructor/Destructor Detail |
protected SSLServerSocket()
protected SSLServerSocket(int port)
protected SSLServerSocket(int port,
int backlog)
protected SSLServerSocket(int port,
int backlog,
InetAddress* pBindAddr)
protected ~SSLServerSocket()
| Method Detail |
virtual size_t getEnabledCipherSuites(StringList& ret) const=0
A given security provider may support more cipher suites than are enabled by default. This is because not all cipher suites are equally secure, so security providers should only enable reasonably secure protocols by default.
ret - virtual bool getNeedClientAuth() const=0
virtual size_t getSupportedCipherSuites(StringList& ret) const=0
ret - virtual bool getUseClientMode() const=0
virtual bool getWantClientAuth() const=0
virtual void setEnabledCipherSuites(const StringList& suites)=0
During SSL negotiations, the list of enabled cipher suites is traversed from beginning to end, with the first acceptable suite being selected. For this reason the application should order the most secure cipher suites at the beginning of the list to help ensure maximum security.
Each value in the list must be a valid cipher suite name as returned by getSupportedCipherSuites().
IllegalArgumentException - virtual void setNeedClientAuth(bool bSet)=0
The provided value is inherited by SSLSockets created during an accept() call.
bSet - virtual void setUseClientMode(bool bClient)=0
The provided value is inherited by SSLSockets created during an accept() call. The default value is false because it is most common for servers to operate in SSL server mode.
bSet - virtual void setWantClientAuth(bool bWantAuth)=0
The provided value is inherited by SSLSockets created during an accept() call.
bSet -
|
OpenTop 1.5 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||||
| SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD | |||||||