|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.Socket
COM.claymoresystems.ptls.SSLSocket
public class SSLSocket
Field Summary |
---|
Fields inherited from interface COM.claymoresystems.sslg.SSLSocketXInt |
---|
CLIENT, SERVER |
Constructor Summary | |
---|---|
SSLSocket()
|
|
SSLSocket(SSLContext ctx,
java.net.InetAddress addr,
int port)
Creates a stream socket and connects it to the specified port number at the specified IP address performing the SSL Handshake |
|
SSLSocket(SSLContext ctx,
java.net.InetAddress addr,
int port,
java.net.InetAddress localAddr,
int localPort)
Creates a stream socket and connects it to the specified port number at the specified IP address performing the SSL Handshake |
|
SSLSocket(SSLContext ctx,
java.io.InputStream input,
java.io.OutputStream output,
java.lang.String host,
int port,
int how)
Create an SSLSocket and connect it to the server on the using the specified input stream and output stream |
|
SSLSocket(SSLContext ctx,
java.net.Socket sock,
java.lang.String host,
int port,
int how)
Create an SSLSocket around the specified socket. |
|
SSLSocket(SSLContext ctx,
java.lang.String remote_addr,
int port)
Create an SSLSocket and connect it to the server on the specified host and port, doing the SSLHandshake |
|
SSLSocket(SSLContext ctx,
java.lang.String remote_addr,
java.lang.Integer remote_port)
Create an SSLSocket and connect it to the server on the specified host and port, doing the SSLHandshake. |
|
SSLSocket(SSLContext ctx,
java.lang.String host,
int port,
java.net.InetAddress localAddr,
int localPort)
Creates a stream socket and connects it to the specified port number at the specified host, performing the SSL Handshake |
Method Summary | |
---|---|
void |
_stompOutputStream(java.io.OutputStream out)
|
void |
close()
close the connection. |
java.util.Vector |
getCertificateChain()
get the certificate chain presented by the peer. |
int |
getCipherSuite()
Get the cipherSuite in use on this socket, as an integer |
java.io.InputStream |
getInputStream()
Get the input stream associated with this socket. |
java.io.OutputStream |
getOutputStream()
Get the input stream associated with this socket. |
SSLPolicyInt |
getPolicy()
Get the policy associated with this socket |
byte[] |
getSessionID()
Get the SessionID associated with this socket |
int |
getVersion()
Get the version of SSL negotiated. |
void |
handshake()
Handshake. |
void |
hardClose()
Hard close. |
static void |
main(java.lang.String[] args)
Test code |
void |
renegotiate()
Renegotiate the SSL connection using the same policy |
void |
renegotiate(SSLPolicyInt policy)
Renegotiate the SSL connection using the given policy |
void |
sendClose()
Send our half of the SSL close_notify handshake |
java.lang.String |
toString()
Converts this socket to a string |
void |
waitForClose(boolean enforceFinished)
Wait to receive a close_notify from the other side. |
Methods inherited from class java.net.Socket |
---|
bind, connect, connect, getChannel, getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SSLSocket(SSLContext ctx, java.lang.String remote_addr, java.lang.Integer remote_port) throws java.net.UnknownHostException, java.io.IOException
ctx
- the SSLContext to use to create this socketremote_addr
- the hostname of the remote machine to connect toremote_port
- the port to connect to
java.io.IOException
- if something goes wrong in the handshake or making the connection
java.net.UnknownHostException
public SSLSocket(SSLContext ctx, java.lang.String remote_addr, int port) throws java.net.UnknownHostException, java.io.IOException
ctx
- the SSLContext to use to create this socketremote_addr
- the hostname of the remote machine to connect toport
- the port to connect to
java.io.IOException
- if something goes wrong in the handshake or making the connection
java.net.UnknownHostException
public SSLSocket(SSLContext ctx, java.net.InetAddress addr, int port) throws java.io.IOException
ctx
- the SSLContext to use to create this socketaddr
- the address to connect toport
- the port to connect to
java.io.IOException
- if something goes wrong in the handshake or making the connection performing the SSL Handshakepublic SSLSocket(SSLContext ctx, java.net.InetAddress addr, int port, java.net.InetAddress localAddr, int localPort) throws java.io.IOException
ctx
- the SSLContext to use to create this socketaddr
- the address to connect toport
- the port to connect tolocalAddr
- the local address to bind tolocalPort
- the local port to bind to
java.io.IOException
- if something goes wrong in the handshake or making the connectionpublic SSLSocket(SSLContext ctx, java.lang.String host, int port, java.net.InetAddress localAddr, int localPort) throws java.io.IOException
ctx
- the SSLContext to use to create this sockethost
- the address to connect toport
- the port to connect tolocalAddr
- the local address to bind tolocalPort
- the local port to bind to
java.io.IOException
- if something goes wrong in the handshake or making the connectionpublic SSLSocket(SSLContext ctx, java.io.InputStream input, java.io.OutputStream output, java.lang.String host, int port, int how) throws java.lang.IllegalArgumentException, java.io.IOException
ctx
- the SSLContext to use to create this socketinput
- where data is read fromoutput
- where data is written toremote_addr
- the hostname of the remote machine (used for session resumption)port
- the port to connect to (used for session resumption: the host/port pair should be unique)how
- which role to take in handshake SSLSocket.CLIENT or SSLSocket.SERVER
java.io.IOException
- if something goes wrong in the handshake or making the connection
java.lang.IllegalArgumentException
public SSLSocket(SSLContext ctx, java.net.Socket sock, java.lang.String host, int port, int how) throws java.lang.IllegalArgumentException, java.io.IOException
ctx
- the SSLContext to use to create this socketsocket
- the underlying socket to wrap aroundremote_addr
- the hostname of the remote machine (used for session resumption)port
- the port to connect to (used for session resumption: the host/port pair should be unique)how
- which role to take in handshake SSLSocket.CLIENT or SSLSocket.SERVER
java.io.IOException
- if something goes wrong in the handshake
java.lang.IllegalArgumentException
public SSLSocket()
Method Detail |
---|
public void hardClose() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in class java.net.Socket
java.io.IOException
- if there is a problem with the close_notifypublic java.io.InputStream getInputStream()
getInputStream
in class java.net.Socket
public java.io.OutputStream getOutputStream()
getOutputStream
in class java.net.Socket
public java.lang.String toString()
toString
in class java.net.Socket
public int getCipherSuite() throws java.io.IOException
getCipherSuite
in interface SSLSocketXInt
java.io.IOException
public java.util.Vector getCertificateChain() throws java.io.IOException
getCertificateChain
in interface SSLSocketXInt
java.io.IOException
public byte[] getSessionID() throws java.io.IOException
getSessionID
in interface SSLSocketXInt
java.io.IOException
public SSLPolicyInt getPolicy()
getPolicy
in interface SSLSocketXInt
public int getVersion() throws java.io.IOException
getVersion
in interface SSLSocketXInt
java.io.IOException
public void handshake() throws java.io.IOException
java.io.IOException
public void renegotiate(SSLPolicyInt policy) throws java.io.IOException
This is useful (for instance) for a server to renegotiate using client authentication
renegotiate
in interface SSLSocketXInt
policy
- the policy to use
java.io.IOException
- if something goes wrong in renegotiationpublic void renegotiate() throws java.io.IOException
This is mainly useful when a client is responding to a server's request for renegotiation
java.io.IOException
public void sendClose() throws java.io.IOException
sendClose
in interface SSLSocketXInt
java.io.IOException
- if the close_notify alert can't be sentpublic void waitForClose(boolean enforceFinished) throws java.io.IOException
waitForClose
in interface SSLSocketXInt
enforceFinished
- insist that no more data be present on the connection before the close_notify is received. This ensures that the application has read all the data that the peer sent
java.io.IOException
- if the close_notify couldn't be read or if enforceFinished is true and more data was present.public void _stompOutputStream(java.io.OutputStream out)
public static void main(java.lang.String[] args) throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |