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

The SSL/TLS protocols add a layer of security over a standard TCP/IP socket connection. This additional security comprises one or more of the following protections:-
Before the handshake commences, the application can influence the choice of cipher suite by specifying an ordered list of acceptable cipher suite names to the setEnabledCipherSuites() method. By default, the security provider will enable only those cipher suites which offer a reasonable level of protection. A list of supported cipher suite names may be obtained using the getSupportedCipherSuites() method. The cipher suite naming convention employed is consistent with the cipher names used within the TLS specification but absent the 'TLS_' prefix.
The SSL handshake can be started explicitly by calling the startHandshake() method. Alternatively, if data is read from or written to the I/O streams associated with the SSLSocket, an implicit handshake is performed before any application data is transferred.
Once the handshake has completed, the SSL connection is associated with a SSLSession, which represents the negotiated parameters and secret keys employed for the duration of the session. The SSLSession object can be obtained by calling the getSession() method.
| Constructor/Destructor Summary | |
SSLSocket()Default constructor which creates an unconnected SSLSocket. | |
SSLSocket(InetAddress* pAddress, int port)Creates a SSLSocket and connects it to the specified port on the network host designated by the provided InetAddress. | |
SSLSocket(const String& host, int port)Creates a SSLSocket that is connected to a specified host name and port. | |
SSLSocket(Socket* pImpl, const String& host, int port)Protected constructor that creates a SSLSocket using the passed Socket. | |
SSLSocket(InetAddress* pAddress, int port, InetAddress* pLocalAddr, int localPort)Creates a SSLSocket and connects it to the specified remote port on the network host designated by the provided InetAddress. | |
SSLSocket(const String& host, int port, InetAddress* pLocalAddr, int localPort)Creates a SSLSocket and connects it to the specified remote port on the network host designated by the provided InetAddress. | |
~SSLSocket()Virtual destructor. | |
| Method Summary | |
virtual void |
addHandshakeCompletedListener(HandshakeCompletedListener* pListener)=0Registers a listener object that will be notified whenever a SSL handshake completes on this SSLSocket. |
virtual size_t |
getEnabledCipherSuites(StringList& ret) const=0Returns an ordered list of cipher suite names which are currently enabled for this SSLSocket. |
virtual bool |
getNeedClientAuth() const=0Returns a boolean flag indicating if client authentication is required during SSL handshaking. |
virtual String |
getPeerHost() constReturns the host name of the remote SSL peer. |
virtual int |
getPeerPort() constReturns the port number of the remote SSL peer. |
virtual RefPtr< SSLSession > |
getSession()=0Returns a SSLSession object representing the set of parameters and secret keys negotiated during a SSL handshake. |
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 this SSLSocket will use SSL client mode during the SSL handshake. |
virtual bool |
getWantClientAuth() const=0Returns a boolean flag indicating if this SSLSocket will request the client to authenticate itself (by sending a certificate) during the SSL handshake. |
virtual void |
removeHandshakeCompletedListener(HandshakeCompletedListener* pListener)=0Unregisters a previously registered listener object. |
virtual void |
setEnabledCipherSuites(const StringList& suites)=0Specifies the permitted cipher suites which may be used during the SSL handshake. |
virtual void |
setNeedClientAuth(bool bSet)=0Specifies whether client authentication is required during the negotiation of the SSL handshake. |
virtual void |
setUseClientMode(bool bClient)=0Controls whether SSL client or server mode will be used during the SSL handshake. |
virtual void |
setWantClientAuth(bool bWantAuth)=0Specifies whether client authentication is requested during the SSL handshake. |
virtual void |
startHandshake()=0Requests the SSLSocket to perform the SSL handshake negotiations with the remote peer. |
| Methods inherited from class ot::ManagedObject |
addRef(), getRefCount(), onFinalRelease(), operator=(const ManagedObject&), release() |
| Methods inherited from class ot::net::Socket |
close(), connect(InetAddress*, int, size_t), connect(InetAddress*, int), connect(const String&, int), getAutoClose(), getInetAddress(), getInputStream(), getKeepAlive(), getLocalAddress(), getLocalPort(), getOutputStream(), getPort(), getReceiveBufferSize(), getSendBufferSize(), getSocketDescriptor(), GetSocketImplFactory(), getSoLinger(), getSoTimeout(), getTcpNoDelay(), hasIOPending(bool, bool), isClosed(), isConnected(), setAutoClose(bool), setKeepAlive(bool), setReceiveBufferSize(size_t), setSendBufferSize(size_t), SetSocketImplFactory(SocketImplFactory*), setSoLinger(bool, size_t), setSoTimeout(size_t), setTcpNoDelay(bool), shutdownInput(), shutdownOutput(), toString() |
| Typedefs |
typedef std::list< String > StringList
| Constructor/Destructor Detail |
protected SSLSocket()
protected SSLSocket(InetAddress* pAddress,
int port)
All SSLSocket constructors are protected and should be used only when implementing a SSL security provider. Instances of SSLSocket may be created using the methods provided by SSLSocketFactory.
SocketException - NullPointerException - protected SSLSocket(const String& host,
int port)
All SSLSocket constructors are protected and should be used only when implementing a SSL security provider. Instances of SSLSocket may be created using the methods provided by SSLSocketFactory.
host - UnknownHostException - SocketException - protected SSLSocket(Socket* pImpl,
const String& host,
int port)
pSocket - NullPointerException - protected SSLSocket(InetAddress* pAddress,
int port,
InetAddress* pLocalAddr,
int localPort)
If pLocalAddr is null, the socket is bound to any interface on the local host. If localPort is 0, the operating system chooses an unused local port number.
All SSLSocket constructors are protected and should be used only when implementing a SSL security provider. Instances of SSLSocket may be created using the methods provided by SSLSocketFactory.
NullPointerException - SocketException - protected SSLSocket(const String& host,
int port,
InetAddress* pLocalAddr,
int localPort)
If pLocalAddr is null, the socket is bound to any interface on the local host. If localPort is 0, the operating system chooses an unused local port number.
All SSLSocket constructors are protected and should be used only when implementing a SSL security provider. Instances of SSLSocket may be created using the methods provided by SSLSocketFactory.
NullPointerException - SocketException - protected ~SSLSocket()
| Method Detail |
virtual void addHandshakeCompletedListener(HandshakeCompletedListener* pListener)=0
pListener - NullPointerException - virtual size_t getEnabledCipherSuites(StringList& ret) const=0
ret - virtual bool getNeedClientAuth() const=0
virtual String getPeerHost() const
virtual int getPeerPort() const
virtual RefPtr< SSLSession > getSession()=0
If the SSL handshake has not yet been performed and the socket is connected to a peer host, the handshake is started causing this method to block until the SSL handshake has completed or an error occurs.
SSLException - virtual size_t getSupportedCipherSuites(StringList& ret) const=0
ret - virtual bool getUseClientMode() const=0
virtual bool getWantClientAuth() const=0
This option is only relevant to SSLSockets operating in SSL server mode.
virtual void removeHandshakeCompletedListener(HandshakeCompletedListener* pListener)=0
pListener - NullPointerException - IllegalArgumentException - virtual void setEnabledCipherSuites(const StringList& suites)=0
Each value in the list must be a valid cipher suite name as returned by getSupportedCipherSuites().
IllegalArgumentException - virtual void setNeedClientAuth(bool bSet)=0
bSet - virtual void setUseClientMode(bool bClient)=0
The default value is true for SSLSockets which have been created by a SSLSocketFactory because it is most common for clients to operate in SSL client mode.
bSet - virtual void setWantClientAuth(bool bWantAuth)=0
bSet - virtual void startHandshake()=0
This method will block until the handshake has completed or an error occurs.
SSLException -
|
OpenTop 1.5 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||||
| SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD | |||||||