Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.net.Socket
org.mozilla.jss.ssl.SSLSocket
public class SSLSocket
extends java.net.Socket
Nested Class Summary | |
static class |
Field Summary | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int |
|
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int |
|
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int |
Constructor Summary | |
| |
| |
| |
| |
| |
| |
| |
|
Method Summary | |
void |
|
void |
|
static void |
|
void |
|
void |
|
void |
|
void |
|
static void |
|
void |
|
static void |
|
void |
|
void |
|
static void |
|
void |
|
protected void |
|
void |
|
boolean |
|
static boolean |
|
static int[] |
|
InetAddress | |
InputStream |
|
boolean |
|
InetAddress | |
int | |
OutputStream |
|
int |
|
int |
|
static String | |
String | |
int |
|
int |
|
int |
|
SSLSecurityStatus |
|
boolean |
|
boolean | |
void |
|
static boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
static void |
|
void |
|
static void |
|
void |
|
static void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
String |
|
void |
|
void |
|
public static final int SSL2_DES_192_EDE3_CBC_WITH_MD5
- Field Value:
- 65287
public static final int SSL2_DES_64_CBC_WITH_MD5
- Field Value:
- 65286
public static final int SSL2_IDEA_128_CBC_WITH_MD5
- Field Value:
- 65285
public static final int SSL2_RC2_128_CBC_EXPORT40_WITH_MD5
- Field Value:
- 65284
public static final int SSL2_RC2_128_CBC_WITH_MD5
- Field Value:
- 65283
public static final int SSL2_RC4_128_EXPORT40_WITH_MD5
- Field Value:
- 65282
public static final int SSL2_RC4_128_WITH_MD5
Note the following cipher-suites constants are not all implemented. You need to call getImplementedCiphersuites.
- Field Value:
- 65281
public static final int SSL3_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
- Field Value:
- 17
public static final int SSL3_DHE_DSS_WITH_3DES_EDE_CBC_SHA
- Field Value:
- 19
public static final int SSL3_DHE_DSS_WITH_DES_CBC_SHA
- Field Value:
- 18
public static final int SSL3_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA
- Field Value:
- 20
public static final int SSL3_DHE_RSA_WITH_3DES_EDE_CBC_SHA
- Field Value:
- 22
public static final int SSL3_DHE_RSA_WITH_DES_CBC_SHA
- Field Value:
- 21
public static final int SSL3_DH_ANON_EXPORT_WITH_DES40_CBC_SHA
- Field Value:
- 25
public static final int SSL3_DH_ANON_EXPORT_WITH_RC4_40_MD5
- Field Value:
- 23
public static final int SSL3_DH_ANON_WITH_3DES_EDE_CBC_SHA
- Field Value:
- 27
public static final int SSL3_DH_ANON_WITH_DES_CBC_SHA
- Field Value:
- 26
public static final int SSL3_DH_ANON_WITH_RC4_128_MD5
- Field Value:
- 24
public static final int SSL3_DH_DSS_EXPORT_WITH_DES40_CBC_SHA
- Field Value:
- 11
public static final int SSL3_DH_DSS_WITH_3DES_EDE_CBC_SHA
- Field Value:
- 13
public static final int SSL3_DH_DSS_WITH_DES_CBC_SHA
- Field Value:
- 12
public static final int SSL3_DH_RSA_EXPORT_WITH_DES40_CBC_SHA
- Field Value:
- 14
public static final int SSL3_DH_RSA_WITH_3DES_EDE_CBC_SHA
- Field Value:
- 16
public static final int SSL3_DH_RSA_WITH_DES_CBC_SHA
- Field Value:
- 15
public static final int SSL3_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA
- Field Value:
- 29
public static final int SSL3_FORTEZZA_DMS_WITH_NULL_SHA
Deprecated. As of NSS 3.11, FORTEZZA is no longer supported. SSL3_FORTEZZA_DMS_WITH_NULL_SHA, SSL3_FORTEZZA_DMS_WITH_RC4_128_SHA and SSL3_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA are placeholders for backward compatibility.
- Field Value:
- 28
public static final int SSL3_FORTEZZA_DMS_WITH_RC4_128_SHA
- Field Value:
- 30
public static final int SSL3_RSA_EXPORT_WITH_DES40_CBC_SHA
- Field Value:
- 8
public static final int SSL3_RSA_EXPORT_WITH_RC2_CBC_40_MD5
- Field Value:
- 6
public static final int SSL3_RSA_EXPORT_WITH_RC4_40_MD5
- Field Value:
- 3
public static final int SSL3_RSA_WITH_3DES_EDE_CBC_SHA
- Field Value:
- 10
public static final int SSL3_RSA_WITH_DES_CBC_SHA
- Field Value:
- 9
public static final int SSL3_RSA_WITH_IDEA_CBC_SHA
- Field Value:
- 7
public static final int SSL3_RSA_WITH_NULL_MD5
- Field Value:
- 1
public static final int SSL3_RSA_WITH_NULL_SHA
- Field Value:
- 2
public static final int SSL3_RSA_WITH_RC4_128_MD5
- Field Value:
- 4
public static final int SSL3_RSA_WITH_RC4_128_SHA
- Field Value:
- 5
public static final int SSL_REQUIRE_ALWAYS
- Field Value:
- 19
public static final int SSL_REQUIRE_FIRST_HANDSHAKE
- Field Value:
- 20
public static final int SSL_REQUIRE_NEVER
- Field Value:
- 18
public static final int SSL_REQUIRE_NO_ERROR
- Field Value:
- 21
public static final int SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA
- Field Value:
- 65279
public static final int SSL_RSA_FIPS_WITH_DES_CBC_SHA
- Field Value:
- 65278
public static final int TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA
- Field Value:
- 99
public static final int TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA
- Field Value:
- 101
public static final int TLS_DHE_DSS_WITH_AES_128_CBC_SHA
- Field Value:
- 50
public static final int TLS_DHE_DSS_WITH_AES_256_CBC_SHA
- Field Value:
- 56
public static final int TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA
- Field Value:
- 68
public static final int TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA
- Field Value:
- 135
public static final int TLS_DHE_DSS_WITH_RC4_128_SHA
- Field Value:
- 102
public static final int TLS_DHE_RSA_WITH_AES_128_CBC_SHA
- Field Value:
- 51
public static final int TLS_DHE_RSA_WITH_AES_256_CBC_SHA
- Field Value:
- 57
public static final int TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
- Field Value:
- 69
public static final int TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
- Field Value:
- 136
public static final int TLS_DH_ANON_WITH_AES_128_CBC_SHA
- Field Value:
- 52
public static final int TLS_DH_ANON_WITH_AES_256_CBC_SHA
- Field Value:
- 58
public static final int TLS_DH_ANON_WITH_CAMELLIA_128_CBC_SHA
- Field Value:
- 70
public static final int TLS_DH_ANON_WITH_CAMELLIA_256_CBC_SHA
- Field Value:
- 137
public static final int TLS_DH_DSS_WITH_AES_128_CBC_SHA
- Field Value:
- 48
public static final int TLS_DH_DSS_WITH_AES_256_CBC_SHA
- Field Value:
- 54
public static final int TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA
- Field Value:
- 66
public static final int TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA
- Field Value:
- 133
public static final int TLS_DH_RSA_WITH_AES_128_CBC_SHA
- Field Value:
- 49
public static final int TLS_DH_RSA_WITH_AES_256_CBC_SHA
- Field Value:
- 55
public static final int TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA
- Field Value:
- 67
public static final int TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA
- Field Value:
- 134
public static final int TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
- Field Value:
- 49160
public static final int TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
- Field Value:
- 49161
public static final int TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
- Field Value:
- 49162
public static final int TLS_ECDHE_ECDSA_WITH_NULL_SHA
- Field Value:
- 49158
public static final int TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
- Field Value:
- 49159
public static final int TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
- Field Value:
- 49170
public static final int TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
- Field Value:
- 49171
public static final int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
- Field Value:
- 49172
public static final int TLS_ECDHE_RSA_WITH_NULL_SHA
- Field Value:
- 49168
public static final int TLS_ECDHE_RSA_WITH_RC4_128_SHA
- Field Value:
- 49169
public static final int TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
- Field Value:
- 49155
public static final int TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
- Field Value:
- 49156
public static final int TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
- Field Value:
- 49157
public static final int TLS_ECDH_ECDSA_WITH_NULL_SHA
- Field Value:
- 49153
public static final int TLS_ECDH_ECDSA_WITH_RC4_128_SHA
- Field Value:
- 49154
public static final int TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
- Field Value:
- 49165
public static final int TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
- Field Value:
- 49166
public static final int TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
- Field Value:
- 49167
public static final int TLS_ECDH_RSA_WITH_NULL_SHA
- Field Value:
- 49163
public static final int TLS_ECDH_RSA_WITH_RC4_128_SHA
- Field Value:
- 49164
public static final int TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA
- Field Value:
- 49175
public static final int TLS_ECDH_anon_WITH_AES_128_CBC_SHA
- Field Value:
- 49176
public static final int TLS_ECDH_anon_WITH_AES_256_CBC_SHA
- Field Value:
- 49177
public static final int TLS_ECDH_anon_WITH_NULL_SHA
- Field Value:
- 49173
public static final int TLS_ECDH_anon_WITH_RC4_128_SHA
- Field Value:
- 49174
public static final int TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA
- Field Value:
- 98
public static final int TLS_RSA_EXPORT1024_WITH_RC4_56_SHA
- Field Value:
- 100
public static final int TLS_RSA_WITH_AES_128_CBC_SHA
- Field Value:
- 47
public static final int TLS_RSA_WITH_AES_256_CBC_SHA
- Field Value:
- 53
public static final int TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
- Field Value:
- 65
public static final int TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
- Field Value:
- 132
public SSLSocket(InetAddress address, int port) throws IOException
Creates an SSL client socket and connects to the specified address and port.
- Parameters:
address
- The IP address to connect to.port
- The port to connect to.
public SSLSocket(InetAddress address, int port, InetAddress localAddr, int localPort) throws IOException
Creates an SSL client socket and connects to the specified address and port. Binds to the given local address and port.
- Parameters:
address
- The IP address to connect to.port
- The port to connect to.localAddr
- The local address to bind to. It can be null, in which case an unspecified local address will be chosen.localPort
- The local port to bind to. If 0, a random port will be assigned to the socket.
public SSLSocket(InetAddress address, int port, InetAddress localAddr, int localPort, boolean stream, SSLCertificateApprovalCallback certApprovalCallback, SSLClientCertificateSelectionCallback clientCertSelectionCallback) throws IOException
Deprecated. As of JSS 3.0. The stream parameter is ignored, because only stream sockets are supported.
Creates an SSL client socket and connects to the specified host and port. Binds to the given local address and port. Installs the given callbacks for certificate approval and client certificate selection.
- Parameters:
port
- The port to connect to.localAddr
- The local address to bind to. It can be null, in which case an unspecified local address will be chosen.localPort
- The local port to bind to. If 0, a random port will be assigned to the socket.stream
- This parameter is ignored. All SSLSockets are stream sockets.certApprovalCallback
- A callback that can be used to override approval of the peer's certificate.clientCertSelectionCallback
- A callback to select the client certificate to present to the peer.
public SSLSocket(InetAddress address, int port, InetAddress localAddr, int localPort, SSLCertificateApprovalCallback certApprovalCallback, SSLClientCertificateSelectionCallback clientCertSelectionCallback) throws IOException
Creates an SSL client socket and connects to the specified address and port. Binds to the given local address and port. Installs the given callbacks for certificate approval and client certificate selection.
- Parameters:
address
- The IP address to connect to.port
- The port to connect to.localAddr
- The local address to bind to. It can be null, in which case an unspecified local address will be chosen.localPort
- The local port to bind to. If 0, a random port will be assigned to the socket.certApprovalCallback
- A callback that can be used to override approval of the peer's certificate.clientCertSelectionCallback
- A callback to select the client certificate to present to the peer.
public SSLSocket(String host, int port) throws UnknownHostException, IOException
Creates an SSL client socket and connects to the specified host and port.
- Parameters:
host
- The hostname to connect to.port
- The port to connect to.
public SSLSocket(String host, int port, InetAddress localAddr, int localPort) throws IOException
Creates an SSL client socket and connects to the specified host and port. Binds to the given local address and port.
- Parameters:
host
- The hostname to connect to.port
- The port to connect to.localAddr
- The local address to bind to. It can be null, in which case an unspecified local address will be chosen.localPort
- The local port to bind to. If 0, a random port will be assigned to the socket.
public SSLSocket(String host, int port, InetAddress localAddr, int localPort, SSLCertificateApprovalCallback certApprovalCallback, SSLClientCertificateSelectionCallback clientCertSelectionCallback) throws IOException
Creates an SSL client socket and connects to the specified host and port. Binds to the given local address and port. Installs the given callbacks for certificate approval and client certificate selection.
- Parameters:
host
- The hostname to connect to.port
- The port to connect to.localAddr
- The local address to bind to. It can be null, in which case an unspecified local address will be chosen.localPort
- The local port to bind to. If 0, a random port will be assigned to the socket.certApprovalCallback
- A callback that can be used to override approval of the peer's certificate.clientCertSelectionCallback
- A callback to select the client certificate to present to the peer.
public SSLSocket(java.net.Socket s, String host, SSLCertificateApprovalCallback certApprovalCallback, SSLClientCertificateSelectionCallback clientCertSelectionCallback) throws IOException
Creates an SSL client socket using the given Java socket for underlying I/O. Installs the given callbacks for certificate approval and client certificate selection.
- Parameters:
s
- The Java socket to use for underlying I/O.host
- The hostname of the remote side of the connection. This name is used to verify the server's certificate.certApprovalCallback
- A callback that can be used to override approval of the peer's certificate.clientCertSelectionCallback
- A callback to select the client certificate to present to the peer.
public void addHandshakeCompletedListener(SSLHandshakeCompletedListener l)
Adds a listener to be notified when an SSL handshake completes.
public void bypassPKCS11(boolean enable) throws SocketException
Enables bypass of PKCS11 on this socket. It is disabled by default, unless the default has been changed withbypassPKCS11Default
.
public static void bypassPKCS11Default(boolean enable) throws SocketException
Sets the default to bypass PKCS11 layer (except for public keys) for all new sockets.
public void close() throws IOException
Closes this socket.
public void enableFDX(boolean enable) throws SocketException
Enable simultaneous read/write by separate read and write threads (full duplex) for this socket. It is disabled by default, unless the default has been changed withenableFDXDefault
.
public void enableRollbackDetection(boolean enable) throws SocketException
Enable rollback detection for this socket. It is enabled by default, unless the default has been changed withenableRollbackDetectionDefault
.
public void enableSSL2(boolean enable) throws SocketException
Enables SSL v2 on this socket. It is enabled by default, unless the default has been changed withenableSSL2Default
.
public static void enableSSL2Default(boolean enable) throws SocketException
Sets the default for SSL v2 for all new sockets.
public void enableSSL3(boolean enable) throws SocketException
Enables SSL v3 on this socket. It is enabled by default, unless the default has been changed withenableSSL3Default
.
public static void enableSSL3Default(boolean enable) throws SocketException
Sets the default for SSL v3 for all new sockets.
public void enableStepDown(boolean enable) throws SocketException
This option, enableStepDown, is concerned with the generation of step-down keys which are used with export suites. If the server cert's public key is 512 bits or less this option is ignored because step-down keys don't need to be generated. If the server cert's public key is more than 512 bits, this option has the following effect: enable=true: generate step-down keys enable=false: don't generate step-down keys; disable export cipher suites This option is enabled by default; unless the default has been changed withSSLSocket.enableStepDownDefault
.
public void enableTLS(boolean enable) throws SocketException
Enables TLS on this socket. It is enabled by default, unless the default has been changed withenableTLSDefault
.
public static void enableTLSDefault(boolean enable) throws SocketException
Sets the default for TLS for all new sockets.
public void enableV2CompatibleHello(boolean enable) throws SocketException
Enable sending v3 client hello in v2 format for this socket. It is enabled by default, unless the default has been changed withenableV2CompatibleHelloDefault
.
protected void finalize() throws Throwable
public void forceHandshake() throws SocketException
Force an already started SSL handshake to complete. This method should block until the handshake has completed.
public boolean getCipherPreference(int cipher) throws SocketException
Returns whether this cipher is enabled or disabled on this socket.
public static boolean getCipherPreferenceDefault(int cipher) throws SocketException
Returns the default for whether this cipher is enabled or disabled.
public static int[] getImplementedCipherSuites()
Returns a list of cipher suites that are implemented by NSS. Each element in the array will be one of the cipher suite constants defined in this class (for example, TLS_RSA_WITH_AES_128_CBC_SHA).
public InetAddress getInetAddress()
- Returns:
- The remote peer's IP address or null if the SSLSocket is closed.
public InputStream getInputStream() throws IOException
Returns the input stream for reading from this socket.
public boolean getKeepAlive() throws SocketException
Returns the current setting of the SO_KEEPALIVE socket option.
public InetAddress getLocalAddress()
- Returns:
- The local IP address or null if the SSLSocket is closed.
public int getLocalPort()
- Returns:
- The local port or -1 if the SSLSocket is closed.
public OutputStream getOutputStream() throws IOException
Returns the output stream for writing to this socket.
public int getPort()
- Returns:
- The remote port.
public int getReceiveBufferSize() throws SocketException
Returnst he size (in bytes) of the receive buffer.
public static String getSSLDefaultOptions()
- Returns:
- a String listing the Default SSLOptions for all SSLSockets.
public String getSSLOptions()
- Returns:
- a String listing the current SSLOptions for this SSLSocket.
public int getSendBufferSize() throws SocketException
Returns the size (in bytes) of the send buffer.
public int getSoLinger() throws SocketException
Returns the current value of the SO_LINGER socket option.
public int getSoTimeout() throws SocketException
Returns the current value of the SO_TIMEOUT socket option.
- Returns:
- The timeout time in milliseconds.
public SSLSecurityStatus getStatus() throws SocketException
Returns the security status of this socket.
public boolean getTcpNoDelay() throws SocketException
Returns the current setting of the TCP_NO_DELAY socket option.
public boolean getUseClientMode()
- Returns:
- true if this end of the socket is the SSL client, false if it is the SSL server.
public void invalidateSession() throws SocketException
Removes the current session from the session cache.
public static boolean isFipsCipherSuite(int ciphersuite) throws SocketException
isFipsCipherSuite
- Returns:
- true if the ciphersuite isFIPS, false otherwise
public void redoHandshake() throws SocketException
Causes SSL to begin a full, new SSL 3.0 handshake from scratch on a connection that has already completed one handshake. Does not flush the SSL3 cache entry first, so a full handshake will not take place. Instead only the symmetric session keys will be regenerated.
public void redoHandshake(boolean flushCache) throws SocketException
Causes SSL to begin a full, new SSL 3.0 handshake from scratch on a connection that has already completed one handshake.
- Parameters:
flushCache
- If true, this session will be flushed from the cache. This will force a complete SSL handshake with a private key operation. If false, only the session key will be regenerated.
public void removeHandshakeCompletedListener(SSLHandshakeCompletedListener l)
Removes a previously registered listener for handshake completion.
public void requestClientAuth(boolean b) throws SocketException
Enables/disables the request of client authentication. This is only meaningful for the server end of the SSL connection. During the next handshake, the remote peer will be asked to authenticate itself.
- See Also:
org.mozilla.jss.ssl.SSLSocket.requireClientAuth
public void requireClientAuth(boolean require, boolean onRedo) throws SocketException
Deprecated. use requireClientAuth(int)
Sets whether the socket requires client authentication from the remote peer. If requestClientAuth() has not already been called, this method will tell the socket to request client auth as well as requiring it.
public void requireClientAuth(int mode) throws SocketException
Sets whether the socket requires client authentication from the remote peer. If requestClientAuth() has not already been called, this method will tell the socket to request client auth as well as requiring it. This is only meaningful for the server end of the SSL connection. During the next handshake, the remote peer will be asked to authenticate itself with the requirement that was set.
- Parameters:
mode
- One of: SSLSocket.SSL_REQUIRE_NEVER, SSLSocket.SSL_REQUIRE_ALWAYS, SSLSocket.SSL_REQUIRE_FIRST_HANDSHAKE, SSLSocket.SSL_REQUIRE_NO_ERROR
public void requireClientAuthDefault(boolean require, boolean onRedo) throws SocketException
Deprecated. use requireClientAuthDefault(int)
Sets the default setting for requiring client authorization. All subsequently created sockets will use this default setting.
public static void requireClientAuthDefault(int mode) throws SocketException
Sets the default setting for requiring client authorization. All subsequently created sockets will use this default setting This is only meaningful for the server end of the SSL connection.
- Parameters:
mode
- One of: SSLSocket.SSL_REQUIRE_NEVER, SSLSocket.SSL_REQUIRE_ALWAYS, SSLSocket.SSL_REQUIRE_FIRST_HANDSHAKE, SSLSocket.SSL_REQUIRE_NO_ERROR
public void resetHandshake() throws SocketException
Resets the handshake state.
public static void setCipherPolicy(SSLSocket.CipherPolicy cp) throws SocketException
Sets the SSL cipher policy. This must be called before creating any SSL sockets.
public void setCipherPreference(int cipher, boolean enable) throws SocketException
Enables/disables the cipher on this socket.
public static void setCipherPreferenceDefault(int cipher, boolean enable) throws SocketException
Sets the default for whether this cipher is enabled or disabled.
public void setClientCert(X509Certificate cert) throws SocketException
Sets the certificate to use for client authentication. Alternately, you can specify an SSLClientCertificateSelectionCallback, which will receive a list of certificates that are valid for client authentication.
public void setClientCertNickname(String nick) throws SocketException
Sets the nickname of the certificate to use for client authentication. Alternately, you can specify an SSLClientCertificateSelectionCallback, which will receive a list of certificates that are valid for client authentication.
public void setKeepAlive(boolean on) throws SocketException
Enables or disables the SO_KEEPALIVE socket option.
public void setNeedClientAuth(boolean b) throws SocketException
Deprecated. As of JSS 3.0. This method is misnamed. Use
requestClientAuth
instead.
public void setNeedClientAuthNoExpiryCheck(boolean b) throws SocketException
Deprecated. As of JSS 3.0. This method is misnamed. Use
requestClientAuthNoExpiryCheck
instead.Enables/disables the request of client authentication. This is only meaningful for the server end of the SSL connection. During the next handshake, the remote peer will be asked to authenticate itself. In addition, the client certificate's expiration will not prevent it from being accepted.
- See Also:
org.mozilla.jss.ssl.SSLSocket.requireClientAuth public void requestClientAuthNoExpiryCheck(boolean b) throws SocketException { base.requestClientAuthNoExpiryCheck(b); } /**
public void setReceiveBufferSize(int size) throws SocketException
Sets the size (in bytes) of the receive buffer.
public void setSendBufferSize(int size) throws SocketException
Sets the size (in bytes) of the send buffer.
public void setSoLinger(boolean on, int linger) throws SocketException
Sets the SO_LINGER socket option. param linger The time (in seconds) to linger for.
public void setSoTimeout(int timeout) throws SocketException
Sets the SO_TIMEOUT socket option.
- Parameters:
timeout
- The timeout time in milliseconds.
public void setTcpNoDelay(boolean on) throws SocketException
Enables or disables the TCP_NO_DELAY socket option. Enabling this option will disable the Nagle algorithm.
public void setUseClientMode(boolean b)
Determines whether this end of the socket is the client or the server for purposes of the SSL protocol. By default, it is the client.
- Parameters:
b
- true if this end of the socket is the SSL slient, false if it is the SSL server.
public void shutdownInput() throws IOException
Shuts down the input side of the socket.
public void shutdownOutput() throws IOException
Shuts down the output side of the socket.
public String toString()
Returns the addresses and ports of this socket or an error message if the socket is not in a valid state.
public void useCache(boolean b) throws SocketException
Enables/disables the session cache. By default, the session cache is enabled.
public void useCacheDefault(boolean b) throws SocketException
Sets the default setting for use of the session cache.