COM.claymoresystems.ptls
public class SSLSocket extends Socket implements SSLSocketXInt
Constructor Summary | |
---|---|
SSLSocket(SSLContext ctx, String remote_addr, Integer remote_port) Create an SSLSocket and connect it to the server on the
specified host and port, doing the SSLHandshake.
| |
SSLSocket(SSLContext ctx, 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, 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, InetAddress addr, int port, 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, String host, int port, InetAddress localAddr, int localPort) Creates a stream socket and connects it to the specified port number at the specified host, performing the SSL Handshake | |
SSLSocket(SSLContext ctx, InputStream input, OutputStream output, 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, Socket sock, String host, int port, int how) Create an SSLSocket around the specified socket.
| |
SSLSocket() |
Method Summary | |
---|---|
void | close() close the connection. |
Vector | getCertificateChain() get the certificate chain presented by the peer. |
int | getCipherSuite() Get the cipherSuite in use on this socket, as an
integer |
InputStream | getInputStream()
Get the input stream associated with this socket.
|
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(String[] args) Test code |
void | renegotiate(SSLPolicyInt policy) Renegotiate the SSL connection using the given policy
This is useful (for instance) for a server to renegotiate using client authentication |
void | renegotiate() Renegotiate the SSL connection using the same policy
This is mainly useful when a client is responding to a server's request for renegotiation |
void | sendClose() Send our half of the SSL close_notify handshake |
String | toString() Converts this socket to a string |
void | waitForClose(boolean enforceFinished) Wait to receive a close_notify from the other side. |
void | _stompOutputStream(OutputStream out) |
Parameters: ctx the SSLContext to use to create this socket remote_addr the hostname of the remote machine to connect to remote_port the port to connect to
Throws: IOException if something goes wrong in the handshake or making the connection
Parameters: ctx the SSLContext to use to create this socket remote_addr the hostname of the remote machine to connect to port the port to connect to
Throws: IOException if something goes wrong in the handshake or making the connection
Parameters: ctx the SSLContext to use to create this socket addr the address to connect to port the port to connect to
Throws: IOException if something goes wrong in the handshake or making the connection performing the SSL Handshake
Parameters: ctx the SSLContext to use to create this socket addr the address to connect to port the port to connect to localAddr the local address to bind to localPort the local port to bind to
Throws: IOException if something goes wrong in the handshake or making the connection
Parameters: ctx the SSLContext to use to create this socket host the address to connect to port the port to connect to localAddr the local address to bind to localPort the local port to bind to
Throws: IOException if something goes wrong in the handshake or making the connection
Parameters: ctx the SSLContext to use to create this socket input where data is read from output where data is written to remote_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
Throws: IOException if something goes wrong in the handshake or making the connection
Parameters: ctx the SSLContext to use to create this socket socket the underlying socket to wrap around remote_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
Throws: IOException if something goes wrong in the handshake
Throws: IOException if there is a problem with the close_notify
Returns: the certificate chain as a Vector of X509Certs, null if unavailable The root is at 0 and the user cert is at n-1
Returns: the ciphersuite in use
Returns: the policy
Returns: the session ID or null if none
Returns: 768 (0x300) for SSLv3 or 769 (0x301) for TLSv1
This is useful (for instance) for a server to renegotiate using client authentication
Parameters: policy the policy to use
This is mainly useful when a client is responding to a server's request for renegotiation
Throws: IOException if the close_notify alert can't be sent
Returns: a string description of this socket
Parameters: 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
Throws: IOException if the close_notify couldn't be read or if enforceFinished is true and more data was present.