This class extends ServerSockets and provides secure server sockets using protocols such as the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocols.
Instances of this class are generally created using a SSLServerSocketFactory. The primary function of SSLServerSockets is to create SSLSockets by accepting connections.
SSLServerSockets contain several pieces of state data which are inherited by the SSLSocket at socket creation. These include the enabled cipher suites and protocols, whether client authentication is necessary, and whether created sockets should begin handshaking in client or server mode. The state inherited by the created SSLSocket can be overriden by calling the appropriate methods.
This class extends ServerSockets and provides secure server sockets using protocols such as the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocols. Instances of this class are generally created using a SSLServerSocketFactory. The primary function of SSLServerSockets is to create SSLSockets by accepting connections. SSLServerSockets contain several pieces of state data which are inherited by the SSLSocket at socket creation. These include the enabled cipher suites and protocols, whether client authentication is necessary, and whether created sockets should begin handshaking in client or server mode. The state inherited by the created SSLSocket can be overriden by calling the appropriate methods.
(get-enable-session-creation? this)
Returns true if new SSL sessions may be established by the sockets which are created from this server socket.
returns: true indicates that sessions may be created; this
is the default. false indicates that an existing
session must be resumed - boolean
Returns true if new SSL sessions may be established by the sockets which are created from this server socket. returns: true indicates that sessions may be created; this is the default. false indicates that an existing session must be resumed - `boolean`
(get-enabled-cipher-suites this)
Returns the list of cipher suites which are currently enabled for use by newly accepted connections.
If this list has not been explicitly modified, a system-provided default guarantees a minimum quality of service in all enabled cipher suites.
There are several reasons why an enabled cipher suite might not actually be used. For example: the server socket might not have appropriate private keys available to it or the cipher suite might be anonymous, precluding the use of client authentication, while the server socket has been told to require that sort of authentication.
returns: an array of cipher suites enabled - java.lang.String[]
Returns the list of cipher suites which are currently enabled for use by newly accepted connections. If this list has not been explicitly modified, a system-provided default guarantees a minimum quality of service in all enabled cipher suites. There are several reasons why an enabled cipher suite might not actually be used. For example: the server socket might not have appropriate private keys available to it or the cipher suite might be anonymous, precluding the use of client authentication, while the server socket has been told to require that sort of authentication. returns: an array of cipher suites enabled - `java.lang.String[]`
(get-enabled-protocols this)
Returns the names of the protocols which are currently enabled for use by the newly accepted connections.
returns: an array of protocol names - java.lang.String[]
Returns the names of the protocols which are currently enabled for use by the newly accepted connections. returns: an array of protocol names - `java.lang.String[]`
(get-need-client-auth? this)
Returns true if client authentication will be required on newly accepted server-mode SSLSockets.
The initial inherited setting may be overridden by calling SSLSocket.setNeedClientAuth(boolean) or SSLSocket.setWantClientAuth(boolean).
returns: true if client authentication is required,
or false if no client authentication is desired. - boolean
Returns true if client authentication will be required on newly accepted server-mode SSLSockets. The initial inherited setting may be overridden by calling SSLSocket.setNeedClientAuth(boolean) or SSLSocket.setWantClientAuth(boolean). returns: true if client authentication is required, or false if no client authentication is desired. - `boolean`
(get-ssl-parameters this)
Returns the SSLParameters in effect for newly accepted connections. The ciphersuites and protocols of the returned SSLParameters are always non-null.
returns: the SSLParameters in effect for newly accepted connections - javax.net.ssl.SSLParameters
Returns the SSLParameters in effect for newly accepted connections. The ciphersuites and protocols of the returned SSLParameters are always non-null. returns: the SSLParameters in effect for newly accepted connections - `javax.net.ssl.SSLParameters`
(get-supported-cipher-suites this)
Returns the names of the cipher suites which could be enabled for use on an SSL connection.
Normally, only a subset of these will actually be enabled by default, since this list may include cipher suites which do not meet quality of service requirements for those defaults. Such cipher suites are useful in specialized applications.
returns: an array of cipher suite names - java.lang.String[]
Returns the names of the cipher suites which could be enabled for use on an SSL connection. Normally, only a subset of these will actually be enabled by default, since this list may include cipher suites which do not meet quality of service requirements for those defaults. Such cipher suites are useful in specialized applications. returns: an array of cipher suite names - `java.lang.String[]`
(get-supported-protocols this)
Returns the names of the protocols which could be enabled for use.
returns: an array of protocol names supported - java.lang.String[]
Returns the names of the protocols which could be enabled for use. returns: an array of protocol names supported - `java.lang.String[]`
(get-use-client-mode? this)
Returns true if accepted connections will be in SSL client mode.
returns: true if the connection should use SSL client mode. - boolean
Returns true if accepted connections will be in SSL client mode. returns: true if the connection should use SSL client mode. - `boolean`
(get-want-client-auth? this)
Returns true if client authentication will be requested on newly accepted server-mode connections.
The initial inherited setting may be overridden by calling SSLSocket.setNeedClientAuth(boolean) or SSLSocket.setWantClientAuth(boolean).
returns: true if client authentication is requested,
or false if no client authentication is desired. - boolean
Returns true if client authentication will be requested on newly accepted server-mode connections. The initial inherited setting may be overridden by calling SSLSocket.setNeedClientAuth(boolean) or SSLSocket.setWantClientAuth(boolean). returns: true if client authentication is requested, or false if no client authentication is desired. - `boolean`
(set-enable-session-creation this flag)
Controls whether new SSL sessions may be established by the sockets which are created from this server socket.
SSLSockets returned from accept() inherit this setting.
flag - true indicates that sessions may be created; this is the default. false indicates that an existing session must be resumed. - boolean
Controls whether new SSL sessions may be established by the sockets which are created from this server socket. SSLSockets returned from accept() inherit this setting. flag - true indicates that sessions may be created; this is the default. false indicates that an existing session must be resumed. - `boolean`
(set-enabled-cipher-suites this suites)
Sets the cipher suites enabled for use by accepted connections.
The cipher suites must have been listed by getSupportedCipherSuites() as being supported. Following a successful call to this method, only suites listed in the suites parameter are enabled for use.
Suites that require authentication information which is not available in this ServerSocket's authentication context will not be used in any case, even if they are enabled.
SSLSockets returned from accept() inherit this setting.
suites - Names of all the cipher suites to enable - java.lang.String[]
throws: java.lang.IllegalArgumentException - when one or more of ciphers named by the parameter is not supported, or when the parameter is null.
Sets the cipher suites enabled for use by accepted connections. The cipher suites must have been listed by getSupportedCipherSuites() as being supported. Following a successful call to this method, only suites listed in the suites parameter are enabled for use. Suites that require authentication information which is not available in this ServerSocket's authentication context will not be used in any case, even if they are enabled. SSLSockets returned from accept() inherit this setting. suites - Names of all the cipher suites to enable - `java.lang.String[]` throws: java.lang.IllegalArgumentException - when one or more of ciphers named by the parameter is not supported, or when the parameter is null.
(set-enabled-protocols this protocols)
Controls which particular protocols are enabled for use by accepted connections.
The protocols must have been listed by getSupportedProtocols() as being supported. Following a successful call to this method, only protocols listed in the protocols parameter are enabled for use.
SSLSockets returned from accept() inherit this setting.
protocols - Names of all the protocols to enable. - java.lang.String[]
throws: java.lang.IllegalArgumentException - when one or more of the protocols named by the parameter is not supported or when the protocols parameter is null.
Controls which particular protocols are enabled for use by accepted connections. The protocols must have been listed by getSupportedProtocols() as being supported. Following a successful call to this method, only protocols listed in the protocols parameter are enabled for use. SSLSockets returned from accept() inherit this setting. protocols - Names of all the protocols to enable. - `java.lang.String[]` throws: java.lang.IllegalArgumentException - when one or more of the protocols named by the parameter is not supported or when the protocols parameter is null.
(set-need-client-auth this need)
Controls whether accepted server-mode SSLSockets will be initially configured to require client authentication.
A socket's client authentication setting is one of the following:
client authentication required client authentication requested no client authentication desired
Unlike setWantClientAuth(boolean), if the accepted socket's option is set and the client chooses not to provide authentication information about itself, the negotiations will stop and the connection will be dropped.
Calling this method overrides any previous setting made by this method or setWantClientAuth(boolean).
The initial inherited setting may be overridden by calling SSLSocket.setNeedClientAuth(boolean) or SSLSocket.setWantClientAuth(boolean).
need - set to true if client authentication is required, or false if no client authentication is desired. - boolean
Controls whether accepted server-mode SSLSockets will be initially configured to require client authentication. A socket's client authentication setting is one of the following: client authentication required client authentication requested no client authentication desired Unlike setWantClientAuth(boolean), if the accepted socket's option is set and the client chooses not to provide authentication information about itself, the negotiations will stop and the connection will be dropped. Calling this method overrides any previous setting made by this method or setWantClientAuth(boolean). The initial inherited setting may be overridden by calling SSLSocket.setNeedClientAuth(boolean) or SSLSocket.setWantClientAuth(boolean). need - set to true if client authentication is required, or false if no client authentication is desired. - `boolean`
(set-ssl-parameters this params)
Applies SSLParameters to newly accepted connections.
This means:
If params.getCipherSuites() is non-null, setEnabledCipherSuites() is called with that value. If params.getProtocols() is non-null, setEnabledProtocols() is called with that value. If params.getNeedClientAuth() or params.getWantClientAuth() return true, setNeedClientAuth(true) and setWantClientAuth(true) are called, respectively; otherwise setWantClientAuth(false) is called. If params.getServerNames() is non-null, the socket will configure its server names with that value. If params.getSNIMatchers() is non-null, the socket will configure its SNI matchers with that value.
params - the parameters - javax.net.ssl.SSLParameters
throws: java.lang.IllegalArgumentException - if the setEnabledCipherSuites() or the setEnabledProtocols() call fails
Applies SSLParameters to newly accepted connections. This means: If params.getCipherSuites() is non-null, setEnabledCipherSuites() is called with that value. If params.getProtocols() is non-null, setEnabledProtocols() is called with that value. If params.getNeedClientAuth() or params.getWantClientAuth() return true, setNeedClientAuth(true) and setWantClientAuth(true) are called, respectively; otherwise setWantClientAuth(false) is called. If params.getServerNames() is non-null, the socket will configure its server names with that value. If params.getSNIMatchers() is non-null, the socket will configure its SNI matchers with that value. params - the parameters - `javax.net.ssl.SSLParameters` throws: java.lang.IllegalArgumentException - if the setEnabledCipherSuites() or the setEnabledProtocols() call fails
(set-use-client-mode this mode)
Controls whether accepted connections are in the (default) SSL server mode, or the SSL client mode.
Servers normally authenticate themselves, and clients are not required to do so.
In rare cases, TCP servers need to act in the SSL client mode on newly accepted connections. For example, FTP clients acquire server sockets and listen there for reverse connections from the server. An FTP client would use an SSLServerSocket in "client" mode to accept the reverse connection while the FTP server uses an SSLSocket with "client" mode disabled to initiate the connection. During the resulting handshake, existing SSL sessions may be reused.
SSLSockets returned from accept() inherit this setting.
mode - true if newly accepted connections should use SSL client mode. - boolean
Controls whether accepted connections are in the (default) SSL server mode, or the SSL client mode. Servers normally authenticate themselves, and clients are not required to do so. In rare cases, TCP servers need to act in the SSL client mode on newly accepted connections. For example, FTP clients acquire server sockets and listen there for reverse connections from the server. An FTP client would use an SSLServerSocket in "client" mode to accept the reverse connection while the FTP server uses an SSLSocket with "client" mode disabled to initiate the connection. During the resulting handshake, existing SSL sessions may be reused. SSLSockets returned from accept() inherit this setting. mode - true if newly accepted connections should use SSL client mode. - `boolean`
(set-want-client-auth this want)
Controls whether accepted server-mode SSLSockets will be initially configured to request client authentication.
A socket's client authentication setting is one of the following:
client authentication required client authentication requested no client authentication desired
Unlike setNeedClientAuth(boolean), if the accepted socket's option is set and the client chooses not to provide authentication information about itself, the negotiations will continue.
Calling this method overrides any previous setting made by this method or setNeedClientAuth(boolean).
The initial inherited setting may be overridden by calling SSLSocket.setNeedClientAuth(boolean) or SSLSocket.setWantClientAuth(boolean).
want - set to true if client authentication is requested, or false if no client authentication is desired. - boolean
Controls whether accepted server-mode SSLSockets will be initially configured to request client authentication. A socket's client authentication setting is one of the following: client authentication required client authentication requested no client authentication desired Unlike setNeedClientAuth(boolean), if the accepted socket's option is set and the client chooses not to provide authentication information about itself, the negotiations will continue. Calling this method overrides any previous setting made by this method or setNeedClientAuth(boolean). The initial inherited setting may be overridden by calling SSLSocket.setNeedClientAuth(boolean) or SSLSocket.setWantClientAuth(boolean). want - set to true if client authentication is requested, or false if no client authentication is desired. - `boolean`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close