public final class SMProxySSLSocketWrapper
extends javax.net.ssl.SSLSocket
This class is never meant to be used by a toolkit application
| Constructor and Description |
|---|
SMProxySSLSocketWrapper(javax.net.ssl.SSLSocket socket,
SMProxyWrapper wrapper)
Wrap a socket which is the parameter for this class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener listener) |
void |
bind(java.net.SocketAddress bindpoint) |
void |
close() |
void |
connect(java.net.SocketAddress endpoint)
Make a connection to an unconnected socket at the specified
endpoint.
|
void |
connect(java.net.SocketAddress endpoint,
int timeout)
Make a connection to an unconnected socket at the specified
endpoint with the given timeout value.
|
java.nio.channels.SocketChannel |
getChannel() |
java.lang.String[] |
getEnabledCipherSuites() |
java.lang.String[] |
getEnabledProtocols() |
boolean |
getEnableSessionCreation() |
java.net.InetAddress |
getInetAddress() |
SMProxySSLSocketFactory.InetHandling |
getInetAddressHandling()
Return how the socket should be configured when created with
an InetAddress
|
java.io.InputStream |
getInputStream() |
boolean |
getKeepAlive() |
java.net.InetAddress |
getLocalAddress() |
int |
getLocalPort() |
java.net.SocketAddress |
getLocalSocketAddress() |
boolean |
getNeedClientAuth() |
boolean |
getOOBInline() |
java.io.OutputStream |
getOutputStream()
Overide the default OutputStream with the SMProxyOutputStream
|
int |
getPort() |
int |
getReceiveBufferSize() |
java.net.SocketAddress |
getRemoteSocketAddress() |
boolean |
getReuseAddress() |
int |
getSendBufferSize() |
javax.net.ssl.SSLSession |
getSession() |
int |
getSoLinger() |
int |
getSoTimeout() |
java.lang.String[] |
getSupportedCipherSuites() |
java.lang.String[] |
getSupportedProtocols() |
boolean |
getTcpNoDelay() |
int |
getTrafficClass() |
boolean |
getUseClientMode() |
boolean |
getWantClientAuth() |
boolean |
isBound() |
boolean |
isClosed() |
boolean |
isConnected() |
boolean |
isInputShutdown() |
boolean |
isOutputShutdown() |
void |
removeHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener listener) |
void |
sendUrgentData(int data) |
void |
setEnabledCipherSuites(java.lang.String[] suites) |
void |
setEnabledProtocols(java.lang.String[] protocols) |
void |
setEnableSessionCreation(boolean flag) |
void |
setHostnameVerifier(javax.net.ssl.HostnameVerifier verifier) |
void |
setInetAddressHandling(SMProxySSLSocketFactory.InetHandling handling)
This API allows the socket to be configured with how a Socket created
with the InetAddress class should be handled.
|
void |
setKeepAlive(boolean on) |
void |
setNeedClientAuth(boolean need) |
void |
setOOBInline(boolean on) |
void |
setPerformancePreferences(int connectionTime,
int latency,
int bandwidth) |
void |
setReceiveBufferSize(int size) |
void |
setReuseAddress(boolean on) |
void |
setSendBufferSize(int size) |
void |
setSoLinger(boolean on,
int l) |
void |
setSoTimeout(int timeout) |
void |
setTcpNoDelay(boolean on) |
void |
setTrafficClass(int tc) |
void |
setUseClientMode(boolean mode) |
void |
setWantClientAuth(boolean want) |
void |
shutdownInput() |
void |
shutdownOutput() |
void |
startHandshake() |
java.lang.String |
toString() |
public SMProxySSLSocketWrapper(javax.net.ssl.SSLSocket socket,
SMProxyWrapper wrapper)
socket - the socket to wrapwrapper - the wrapperSMProxyException - if either or the parameters is nullpublic void addHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener listener)
addHandshakeCompletedListener in class javax.net.ssl.SSLSocketpublic boolean getEnableSessionCreation()
getEnableSessionCreation in class javax.net.ssl.SSLSocketpublic java.lang.String[] getEnabledCipherSuites()
getEnabledCipherSuites in class javax.net.ssl.SSLSocketpublic java.lang.String[] getEnabledProtocols()
getEnabledProtocols in class javax.net.ssl.SSLSocketpublic boolean getNeedClientAuth()
getNeedClientAuth in class javax.net.ssl.SSLSocketpublic javax.net.ssl.SSLSession getSession()
getSession in class javax.net.ssl.SSLSocketpublic java.lang.String[] getSupportedCipherSuites()
getSupportedCipherSuites in class javax.net.ssl.SSLSocketpublic java.lang.String[] getSupportedProtocols()
getSupportedProtocols in class javax.net.ssl.SSLSocketpublic boolean getUseClientMode()
getUseClientMode in class javax.net.ssl.SSLSocketpublic boolean getWantClientAuth()
getWantClientAuth in class javax.net.ssl.SSLSocketpublic void removeHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener listener)
removeHandshakeCompletedListener in class javax.net.ssl.SSLSocketpublic void setEnableSessionCreation(boolean flag)
setEnableSessionCreation in class javax.net.ssl.SSLSocketpublic void setEnabledCipherSuites(java.lang.String[] suites)
setEnabledCipherSuites in class javax.net.ssl.SSLSocketpublic void setEnabledProtocols(java.lang.String[] protocols)
setEnabledProtocols in class javax.net.ssl.SSLSocketpublic void setNeedClientAuth(boolean need)
setNeedClientAuth in class javax.net.ssl.SSLSocketpublic void setUseClientMode(boolean mode)
setUseClientMode in class javax.net.ssl.SSLSocketpublic void setWantClientAuth(boolean want)
setWantClientAuth in class javax.net.ssl.SSLSocketpublic void startHandshake()
throws java.io.IOException
startHandshake in class javax.net.ssl.SSLSocketjava.io.IOExceptionpublic void setInetAddressHandling(SMProxySSLSocketFactory.InetHandling handling)
public enum InetHandling {HOSTNAME, IPADDRESS, REJECT}
Note: Using a hostname to create the socket is always safe.
handling - enumerated type.public SMProxySSLSocketFactory.InetHandling getInetAddressHandling() throws java.io.IOException
REJECT which will throw an exception
HOSTNAME which will assume InetAddress is created with a hostname
IPADDRESS which will assume InetAddress is created with an IP
COMPAT - Compatible with previous versions of the toolkit. Uses Session.getPeerHost
to lookup the hostname
java.io.IOExceptionpublic void connect(java.net.SocketAddress endpoint,
int timeout)
throws java.io.IOException
connect in class java.net.Socketjava.io.IOExceptionpublic void connect(java.net.SocketAddress endpoint)
throws java.io.IOException
connect in class java.net.Socketjava.io.IOExceptionpublic void setHostnameVerifier(javax.net.ssl.HostnameVerifier verifier)
public java.nio.channels.SocketChannel getChannel()
getChannel in class java.net.Socketpublic java.net.InetAddress getInetAddress()
getInetAddress in class java.net.Socketpublic boolean getKeepAlive()
throws java.net.SocketException
getKeepAlive in class java.net.Socketjava.net.SocketExceptionpublic java.net.InetAddress getLocalAddress()
getLocalAddress in class java.net.Socketpublic int getLocalPort()
getLocalPort in class java.net.Socketpublic java.net.SocketAddress getLocalSocketAddress()
getLocalSocketAddress in class java.net.Socketpublic boolean getOOBInline()
throws java.net.SocketException
getOOBInline in class java.net.Socketjava.net.SocketExceptionpublic int getPort()
getPort in class java.net.Socketpublic int getReceiveBufferSize()
throws java.net.SocketException
getReceiveBufferSize in class java.net.Socketjava.net.SocketExceptionpublic java.net.SocketAddress getRemoteSocketAddress()
getRemoteSocketAddress in class java.net.Socketpublic boolean getReuseAddress()
throws java.net.SocketException
getReuseAddress in class java.net.Socketjava.net.SocketExceptionpublic int getSendBufferSize()
throws java.net.SocketException
getSendBufferSize in class java.net.Socketjava.net.SocketExceptionpublic int getSoLinger()
throws java.net.SocketException
getSoLinger in class java.net.Socketjava.net.SocketExceptionpublic int getSoTimeout()
throws java.net.SocketException
getSoTimeout in class java.net.Socketjava.net.SocketExceptionpublic boolean getTcpNoDelay()
throws java.net.SocketException
getTcpNoDelay in class java.net.Socketjava.net.SocketExceptionpublic int getTrafficClass()
throws java.net.SocketException
getTrafficClass in class java.net.Socketjava.net.SocketExceptionpublic boolean isBound()
isBound in class java.net.Socketpublic boolean isClosed()
isClosed in class java.net.Socketpublic boolean isConnected()
isConnected in class java.net.Socketpublic boolean isInputShutdown()
isInputShutdown in class java.net.Socketpublic boolean isOutputShutdown()
isOutputShutdown in class java.net.Socketpublic void sendUrgentData(int data)
throws java.io.IOException
sendUrgentData in class java.net.Socketjava.io.IOExceptionpublic void setKeepAlive(boolean on)
throws java.net.SocketException
setKeepAlive in class java.net.Socketjava.net.SocketExceptionpublic void setOOBInline(boolean on)
throws java.net.SocketException
setOOBInline in class java.net.Socketjava.net.SocketExceptionpublic void setReceiveBufferSize(int size)
throws java.net.SocketException
setReceiveBufferSize in class java.net.Socketjava.net.SocketExceptionpublic void setReuseAddress(boolean on)
throws java.net.SocketException
setReuseAddress in class java.net.Socketjava.net.SocketExceptionpublic void setSendBufferSize(int size)
throws java.net.SocketException
setSendBufferSize in class java.net.Socketjava.net.SocketExceptionpublic void setSoLinger(boolean on,
int l)
throws java.net.SocketException
setSoLinger in class java.net.Socketjava.net.SocketExceptionpublic void setSoTimeout(int timeout)
throws java.net.SocketException
setSoTimeout in class java.net.Socketjava.net.SocketExceptionpublic void setTcpNoDelay(boolean on)
throws java.net.SocketException
setTcpNoDelay in class java.net.Socketjava.net.SocketExceptionpublic void setTrafficClass(int tc)
throws java.net.SocketException
setTrafficClass in class java.net.Socketjava.net.SocketExceptionpublic void shutdownInput()
throws java.io.IOException
shutdownInput in class java.net.Socketjava.io.IOExceptionpublic void shutdownOutput()
throws java.io.IOException
shutdownOutput in class java.net.Socketjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.net.Socketpublic void setPerformancePreferences(int connectionTime,
int latency,
int bandwidth)
setPerformancePreferences in class java.net.Socketpublic void bind(java.net.SocketAddress bindpoint)
throws java.io.IOException
bind in class java.net.Socketjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.net.Socketjava.io.IOExceptionpublic java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class java.net.Socketjava.io.IOExceptionpublic java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in class java.net.Socketjava.io.IOException