## org.apache.catalina.net
Class SSLServerSocketFactory

    java.lang.Object
      org.apache.catalina.net.SSLServerSocketFactory

All Implemented Interfaces:
  ServerSocketFactory

public class SSLServerSocketFactory
extends java.lang.Object
implements ServerSocketFactory

Socket factory for SSL sockets, using the Java Server Sockets Extension (JSSE) reference implementation support classes. 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 to `setAttribute()`. 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
`SSLServerSocketFactory()`

Method Summary
`java.net.ServerSocket` `createSocket(int port)` Return a server socket that uses all network interfaces on the host, and is bound to a specified port.
`java.net.ServerSocket` `createSocket(int port, int backlog)` Return a server socket that uses all network interfaces on the host, and is bound to a specified port, and uses the specified connection backlog.
`java.net.ServerSocket` `createSocket(int port, int backlog, java.net.InetAddress ifAddress)` Return a server socket that uses the specified interface on the host, and is bound to a specified port, and uses the specified connection backlog.
`java.lang.String` `getAlgorithm()`
`boolean` `getClientAuth()`
`java.security.KeyStore` `getKeyStore()`
`java.lang.String` `getKeystoreFile()`
`java.lang.String` `getKeystoreType()`
`java.lang.String` `getProtocol()`
`void` `setAlgorithm(java.lang.String algorithm)`
`void` `setClientAuth(boolean clientAuth)`
`void` `setKeystoreFile(java.lang.String keystoreFile)`
`void` `setKeystorePass(java.lang.String keystorePass)`
`void` `setKeystoreType(java.lang.String keystoreType)`
`void` `setProtocol(java.lang.String protocol)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SSLServerSocketFactory

    public SSLServerSocketFactory()

Method Detail

### getAlgorithm

    public java.lang.String getAlgorithm()

### setAlgorithm

    public void setAlgorithm(java.lang.String algorithm)

### getClientAuth

    public boolean getClientAuth()

### setClientAuth

    public void setClientAuth(boolean clientAuth)

### getKeyStore

    public java.security.KeyStore getKeyStore()
                                       throws java.io.IOException,
                                              java.security.KeyStoreException,
                                              java.security.NoSuchAlgorithmException,
                                              java.security.cert.CertificateException,
                                              java.security.UnrecoverableKeyException,
                                              java.security.KeyManagementException

  Throws:
    `java.io.IOException`
    `java.security.KeyStoreException`
    `java.security.NoSuchAlgorithmException`
    `java.security.cert.CertificateException`
    `java.security.UnrecoverableKeyException`
    `java.security.KeyManagementException`

### getKeystoreFile

    public java.lang.String getKeystoreFile()

### setKeystoreFile

    public void setKeystoreFile(java.lang.String keystoreFile)

### setKeystorePass

    public void setKeystorePass(java.lang.String keystorePass)

### getKeystoreType

    public java.lang.String getKeystoreType()

### setKeystoreType

    public void setKeystoreType(java.lang.String keystoreType)

### getProtocol

    public java.lang.String getProtocol()

### setProtocol

    public void setProtocol(java.lang.String protocol)

### createSocket

    public java.net.ServerSocket createSocket(int port)
                                       throws java.io.IOException,
                                              java.security.KeyStoreException,
                                              java.security.NoSuchAlgorithmException,
                                              java.security.cert.CertificateException,
                                              java.security.UnrecoverableKeyException,
                                              java.security.KeyManagementException

  Return a server socket that uses all network interfaces on the host, and is bound to a specified port. The socket is configured with the socket options (such as accept timeout) given to this factory.

  Specified by:
    `createSocket` in interface `ServerSocketFactory`
  Parameters:
    `port` - Port to listen to
  Throws:
    `java.io.IOException` - input/output or network error
    `java.security.KeyStoreException` - error instantiating the KeyStore from file
    `java.security.NoSuchAlgorithmException` - KeyStore algorithm unsupported by current provider
    `java.security.cert.CertificateException` - general certificate error
    `java.security.UnrecoverableKeyException` - internal KeyStore problem with the certificate
    `java.security.KeyManagementException` - problem in the key management layer

### createSocket

    public java.net.ServerSocket createSocket(int port,
                                              int backlog)
                                       throws java.io.IOException,
                                              java.security.KeyStoreException,
                                              java.security.NoSuchAlgorithmException,
                                              java.security.cert.CertificateException,
                                              java.security.UnrecoverableKeyException,
                                              java.security.KeyManagementException

  Return a server socket that uses all network interfaces on the host, and is bound to a 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:
    `createSocket` in interface `ServerSocketFactory`
  Parameters:
    `port` - Port to listen to
    `backlog` - Maximum number of connections to be queued
  Throws:
    `java.io.IOException` - input/output or network error
    `java.security.KeyStoreException` - error instantiating the KeyStore from file
    `java.security.NoSuchAlgorithmException` - KeyStore algorithm unsupported by current provider
    `java.security.cert.CertificateException` - general certificate error
    `java.security.UnrecoverableKeyException` - internal KeyStore problem with the certificate
    `java.security.KeyManagementException` - problem in the key management layer

### createSocket

    public java.net.ServerSocket createSocket(int port,
                                              int backlog,
                                              java.net.InetAddress ifAddress)
                                       throws java.io.IOException,
                                              java.security.KeyStoreException,
                                              java.security.NoSuchAlgorithmException,
                                              java.security.cert.CertificateException,
                                              java.security.UnrecoverableKeyException,
                                              java.security.KeyManagementException

  Return a server socket that uses the specified interface on the host, and is bound to a 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:
    `createSocket` in interface `ServerSocketFactory`
  Parameters:
    `port` - Port to listen to
    `backlog` - Maximum number of connections to be queued
    `ifAddress` - Address of the interface to be used
  Throws:
    `java.io.IOException` - input/output or network error
    `java.security.KeyStoreException` - error instantiating the KeyStore from file
    `java.security.NoSuchAlgorithmException` - KeyStore algorithm unsupported by current provider
    `java.security.cert.CertificateException` - general certificate error
    `java.security.UnrecoverableKeyException` - internal KeyStore problem with the certificate
    `java.security.KeyManagementException` - problem in the key management layer

Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.