Package org.apache.catalina.connector
Class CoyoteServerSocketFactory
- java.lang.Object
-
- org.apache.catalina.connector.CoyoteServerSocketFactory
-
- All Implemented Interfaces:
ServerSocketFactory
public class CoyoteServerSocketFactory extends Object implements ServerSocketFactory
This socket factory holds secure socket factory parameters. Besides the usual configuration mechanism based on setting JavaBeans properties, this component may also be configured by passing a series of attributes set with calls tosetAttribute(). The following attribute names are recognized, with default values in square brackets:- algorithm - Certificate encoding algorithm to use. [SunX509]
- clientAuth - Require client authentication if
set to
true. [false] - keystoreFile - Pathname to the Key Store file to be loaded. This must be an absolute path, or a relative path that is resolved against the "catalina.base" system property. ["./keystore" in the user home directory]
- keystorePass - Password for the Key Store file to be loaded. ["changeit"]
- keystoreType - Type of the Key Store file to be loaded. ["JKS"]
- protocol - SSL protocol to use. [TLS]
- Author:
- Harish Prabandham, Costin Manolache, Craig McClanahan
-
-
Constructor Summary
Constructors Constructor Description CoyoteServerSocketFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerSocketcreateSocket(int port)Returns a server socket which uses all network interfaces on the host, and is bound to a the specified port.ServerSocketcreateSocket(int port, int backlog)Returns a server socket which uses all network interfaces on the host, is bound to a the specified port, and uses the specified connection backlog.ServerSocketcreateSocket(int port, int backlog, InetAddress ifAddress)Returns a server socket which uses only the specified network interface on the local host, is bound to a the specified port, and uses the specified connection backlog.StringgetAlgorithm()Gets the certificate encoding algorithm to be used.StringgetCiphers()Gets the list of SSL cipher suites that are to be enabledbooleangetClientAuth()Provides information about whether client authentication is enforced.StringgetKeyAlias()Gets the alias name of the keypair and supporting certificate chain used by the server to authenticate itself to SSL clients.StringgetKeystoreFile()Gets the pathname to the keystore file.StringgetKeystorePass()Gets the keystore password.StringgetKeystoreType()Gets the keystore type.StringgetProtocol()Gets the SSL protocol variant to be used.StringgetProtocols()Gets the SSL protocol variants to be enabled.StringgetRandomFile()Gets the pathname to the random file.StringgetRootFile()Gets the pathname to the root list.StringgetSSLImplementation()Gets the name of the SSL implementation to be used.voidsetAlgorithm(String algorithm)Sets the certificate encoding algorithm to be used.voidsetCiphers(String ciphers)Sets the SSL cipher suites that are to be enabled.voidsetClientAuth(boolean clientAuth)Sets the requirement of client authentication.voidsetKeyAlias(String alias)Sets the alias name of the keypair and supporting certificate chain used by the server to authenticate itself to SSL clients.voidsetKeystoreFile(String keystoreFile)Sets the pathname to the keystore file.voidsetKeystorePass(String keystorePass)Sets the keystore password.voidsetKeystoreType(String keystoreType)Sets the keystore type.voidsetProtocol(String protocol)Sets the SSL protocol variant to be used.voidsetProtocols(String protocols)Sets the SSL protocol variants to be enabled.voidsetRandomFile(String randomFile)Sets the pathname to the random file.voidsetRootFile(String rootFile)Sets the pathname to the root list.voidsetSSLImplementation(String sslImplementation)Sets the name of the SSL implementation to be used.
-
-
-
Method Detail
-
getAlgorithm
public String getAlgorithm()
Gets the certificate encoding algorithm to be used.- Returns:
- Certificate encoding algorithm
-
setAlgorithm
public void setAlgorithm(String algorithm)
Sets the certificate encoding algorithm to be used.- Parameters:
algorithm- Certificate encoding algorithm
-
getClientAuth
public boolean getClientAuth()
Provides information about whether client authentication is enforced.- Returns:
- true if client authentication is enforced, false otherwise
-
setClientAuth
public void setClientAuth(boolean clientAuth)
Sets the requirement of client authentication.- Parameters:
clientAuth- true if client authentication is enforced, false otherwise
-
getKeystoreFile
public String getKeystoreFile()
Gets the pathname to the keystore file.- Returns:
- Pathname to the keystore file
-
setKeystoreFile
public void setKeystoreFile(String keystoreFile)
Sets the pathname to the keystore file.- Parameters:
keystoreFile- Pathname to the keystore file
-
getRandomFile
public String getRandomFile()
Gets the pathname to the random file.- Returns:
- Pathname to the random file
-
setRandomFile
public void setRandomFile(String randomFile)
Sets the pathname to the random file.- Parameters:
randomFile- Pathname to the random file
-
getRootFile
public String getRootFile()
Gets the pathname to the root list.- Returns:
- Pathname to the root list
-
setRootFile
public void setRootFile(String rootFile)
Sets the pathname to the root list.- Parameters:
rootFile- Pathname to the root list
-
getKeystorePass
public String getKeystorePass()
Gets the keystore password.- Returns:
- Keystore password
-
setKeystorePass
public void setKeystorePass(String keystorePass)
Sets the keystore password.- Parameters:
keystorePass- Keystore password
-
getKeystoreType
public String getKeystoreType()
Gets the keystore type.- Returns:
- Keystore type
-
setKeystoreType
public void setKeystoreType(String keystoreType)
Sets the keystore type.- Parameters:
keystoreType- Keystore type
-
getProtocol
public String getProtocol()
Gets the SSL protocol variant to be used.- Returns:
- SSL protocol variant
-
setProtocol
public void setProtocol(String protocol)
Sets the SSL protocol variant to be used.- Parameters:
protocol- SSL protocol variant
-
getProtocols
public String getProtocols()
Gets the SSL protocol variants to be enabled.- Returns:
- Comma-separated list of SSL protocol variants
-
setProtocols
public void setProtocols(String protocols)
Sets the SSL protocol variants to be enabled.- Parameters:
protocols- Comma-separated list of SSL protocol variants
-
getSSLImplementation
public String getSSLImplementation()
Gets the name of the SSL implementation to be used.- Returns:
- SSL implementation name
-
setSSLImplementation
public void setSSLImplementation(String sslImplementation)
Sets the name of the SSL implementation to be used.- Parameters:
sslImplementation- SSL implementation name
-
getKeyAlias
public String getKeyAlias()
Gets the alias name of the keypair and supporting certificate chain used by the server to authenticate itself to SSL clients.- Returns:
- The alias name of the keypair and supporting certificate chain
-
setKeyAlias
public void setKeyAlias(String alias)
Sets the alias name of the keypair and supporting certificate chain used by the server to authenticate itself to SSL clients.- Parameters:
alias- The alias name of the keypair and supporting certificate chain
-
getCiphers
public String getCiphers()
Gets the list of SSL cipher suites that are to be enabled- Returns:
- Comma-separated list of SSL cipher suites, or null if all cipher suites supported by the underlying SSL implementation are being enabled
-
setCiphers
public void setCiphers(String ciphers)
Sets the SSL cipher suites that are to be enabled. Only those SSL cipher suites that are actually supported by the underlying SSL implementation will be enabled.- Parameters:
ciphers- Comma-separated list of SSL cipher suites
-
createSocket
public ServerSocket createSocket(int port)
Description copied from interface:ServerSocketFactoryReturns a server socket which uses all network interfaces on the host, and is bound to a the specified port. The socket is configured with the socket options (such as accept timeout) given to this factory.- Specified by:
createSocketin interfaceServerSocketFactory- Parameters:
port- the port to listen to
-
createSocket
public ServerSocket createSocket(int port, int backlog)
Description copied from interface:ServerSocketFactoryReturns a server socket which uses all network interfaces on the host, is bound to a the specified port, and uses the specified connection backlog. The socket is configured with the socket options (such as accept timeout) given to this factory.- Specified by:
createSocketin interfaceServerSocketFactory- Parameters:
port- the port to listen tobacklog- how many connections are queued
-
createSocket
public ServerSocket createSocket(int port, int backlog, InetAddress ifAddress)
Description copied from interface:ServerSocketFactoryReturns a server socket which uses only the specified network interface on the local host, is bound to a the specified port, and uses the specified connection backlog. The socket is configured with the socket options (such as accept timeout) given to this factory.- Specified by:
createSocketin interfaceServerSocketFactory- Parameters:
port- the port to listen tobacklog- how many connections are queuedifAddress- the network interface address to use
-
-