- java.lang.Object
-
- javax.rmi.ssl.SslRMIServerSocketFactory
-
- All Implemented Interfaces:
- RMIServerSocketFactory
public class SslRMIServerSocketFactory extends Object implements RMIServerSocketFactory
An
SslRMIServerSocketFactory
instance is used by the RMI runtime in order to obtain server sockets for RMI calls via SSL.This class implements
RMIServerSocketFactory
over the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocols.This class creates SSL sockets using the default
SSLSocketFactory
(seeSSLSocketFactory.getDefault()
) or the defaultSSLServerSocketFactory
(seeSSLServerSocketFactory.getDefault()
) unless the constructor taking anSSLContext
is used in which case the SSL sockets are created using theSSLSocketFactory
returned bySSLContext.getSocketFactory()
or theSSLServerSocketFactory
returned bySSLContext.getServerSocketFactory()
. When anSSLContext
is not supplied all the instances of this class share the same keystore, and the same truststore (when client authentication is required by the server). This behavior can be modified by supplying an already initializedSSLContext
instance.- Since:
- 1.5
- See Also:
SSLSocketFactory
,SSLServerSocketFactory
,SslRMIClientSocketFactory
-
-
Constructor Summary
Constructors Constructor and Description SslRMIServerSocketFactory()
Creates a newSslRMIServerSocketFactory
with the default SSL socket configuration.SslRMIServerSocketFactory(SSLContext context, String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth)
Creates a newSslRMIServerSocketFactory
with the specifiedSSLContext
and SSL socket configuration.SslRMIServerSocketFactory(String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth)
Creates a newSslRMIServerSocketFactory
with the specified SSL socket configuration.
-
Method Summary
Methods Modifier and Type Method and Description ServerSocket
createServerSocket(int port)
Creates a server socket that accepts SSL connections configured according to this factory's SSL socket configuration parameters.boolean
equals(Object obj)
Indicates whether some other object is "equal to" this one.String[]
getEnabledCipherSuites()
Returns the names of the cipher suites enabled on SSL connections accepted by server sockets created by this factory, ornull
if this factory uses the cipher suites that are enabled by default.String[]
getEnabledProtocols()
Returns the names of the protocol versions enabled on SSL connections accepted by server sockets created by this factory, ornull
if this factory uses the protocol versions that are enabled by default.boolean
getNeedClientAuth()
Returnstrue
if client authentication is required on SSL connections accepted by server sockets created by this factory.int
hashCode()
Returns a hash code value for thisSslRMIServerSocketFactory
.
-
-
-
Constructor Detail
-
SslRMIServerSocketFactory
public SslRMIServerSocketFactory()
Creates a new
SslRMIServerSocketFactory
with the default SSL socket configuration.SSL connections accepted by server sockets created by this factory have the default cipher suites and protocol versions enabled and do not require client authentication.
-
SslRMIServerSocketFactory
public SslRMIServerSocketFactory(String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth) throws IllegalArgumentException
Creates a new
SslRMIServerSocketFactory
with the specified SSL socket configuration.- Parameters:
enabledCipherSuites
- names of all the cipher suites to enable on SSL connections accepted by server sockets created by this factory, ornull
to use the cipher suites that are enabled by defaultenabledProtocols
- names of all the protocol versions to enable on SSL connections accepted by server sockets created by this factory, ornull
to use the protocol versions that are enabled by defaultneedClientAuth
-true
to require client authentication on SSL connections accepted by server sockets created by this factory;false
to not require client authentication- Throws:
IllegalArgumentException
- when one or more of the cipher suites named by theenabledCipherSuites
parameter is not supported, when one or more of the protocols named by theenabledProtocols
parameter is not supported or when a problem is encountered while trying to check if the supplied cipher suites and protocols to be enabled are supported.- See Also:
SSLSocket.setEnabledCipherSuites(java.lang.String[])
,SSLSocket.setEnabledProtocols(java.lang.String[])
,SSLSocket.setNeedClientAuth(boolean)
-
SslRMIServerSocketFactory
public SslRMIServerSocketFactory(SSLContext context, String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth) throws IllegalArgumentException
Creates a new
SslRMIServerSocketFactory
with the specifiedSSLContext
and SSL socket configuration.- Parameters:
context
- the SSL context to be used for creating SSL sockets. Ifcontext
is null the defaultSSLSocketFactory
or the defaultSSLServerSocketFactory
will be used to create SSL sockets. Otherwise, the socket factory returned bySSLContext.getSocketFactory()
orSSLContext.getServerSocketFactory()
will be used instead.enabledCipherSuites
- names of all the cipher suites to enable on SSL connections accepted by server sockets created by this factory, ornull
to use the cipher suites that are enabled by defaultenabledProtocols
- names of all the protocol versions to enable on SSL connections accepted by server sockets created by this factory, ornull
to use the protocol versions that are enabled by defaultneedClientAuth
-true
to require client authentication on SSL connections accepted by server sockets created by this factory;false
to not require client authentication- Throws:
IllegalArgumentException
- when one or more of the cipher suites named by theenabledCipherSuites
parameter is not supported, when one or more of the protocols named by theenabledProtocols
parameter is not supported or when a problem is encountered while trying to check if the supplied cipher suites and protocols to be enabled are supported.- Since:
- 1.7
- See Also:
SSLSocket.setEnabledCipherSuites(java.lang.String[])
,SSLSocket.setEnabledProtocols(java.lang.String[])
,SSLSocket.setNeedClientAuth(boolean)
-
-
Method Detail
-
getEnabledCipherSuites
public final String[] getEnabledCipherSuites()
Returns the names of the cipher suites enabled on SSL connections accepted by server sockets created by this factory, or
null
if this factory uses the cipher suites that are enabled by default.- Returns:
- an array of cipher suites enabled, or
null
- See Also:
SSLSocket.setEnabledCipherSuites(java.lang.String[])
-
getEnabledProtocols
public final String[] getEnabledProtocols()
Returns the names of the protocol versions enabled on SSL connections accepted by server sockets created by this factory, or
null
if this factory uses the protocol versions that are enabled by default.- Returns:
- an array of protocol versions enabled, or
null
- See Also:
SSLSocket.setEnabledProtocols(java.lang.String[])
-
getNeedClientAuth
public final boolean getNeedClientAuth()
Returns
true
if client authentication is required on SSL connections accepted by server sockets created by this factory.- Returns:
true
if client authentication is required- See Also:
SSLSocket.setNeedClientAuth(boolean)
-
createServerSocket
public ServerSocket createServerSocket(int port) throws IOException
Creates a server socket that accepts SSL connections configured according to this factory's SSL socket configuration parameters.
- Specified by:
createServerSocket
in interfaceRMIServerSocketFactory
- Parameters:
port
- the port number- Returns:
- the server socket on the specified port
- Throws:
IOException
- if an I/O error occurs during server socket creation
-
equals
public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.
Two
SslRMIServerSocketFactory
objects are equal if they have been constructed with the same SSL context and SSL socket configuration parameters.A subclass should override this method (as well as
hashCode()
) if it adds instance state that affects equality.- Overrides:
equals
in classObject
- Parameters:
obj
- the reference object with which to compare.- Returns:
true
if this object is the same as the obj argument;false
otherwise.- See Also:
Object.hashCode()
,HashMap
-
hashCode
public int hashCode()
Returns a hash code value for this
SslRMIServerSocketFactory
.- Overrides:
hashCode
in classObject
- Returns:
- a hash code value for this
SslRMIServerSocketFactory
. - See Also:
Object.equals(java.lang.Object)
,System.identityHashCode(java.lang.Object)
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
22/12/2024 10:32:57 Cette version de la page est en cache (à la date du 22/12/2024 10:32:57) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 01/09/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/rmi/ssl/SslRMIServerSocketFactory.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.