SSLServerSocketFactory

public abstract class SSLServerSocketFactory
extends ServerSocketFactory

java.lang.Object
   ↳ javax.net.ServerSocketFactory
     ↳ javax.net.ssl.SSLServerSocketFactory


SSLServerSocketFactorys create SSLServerSockets.

Summary

Protected constructors

SSLServerSocketFactory()

Constructor is used only by subclasses.

Public methods

static ServerSocketFactory getDefault()

Returns the default SSL server socket factory.

abstract String[] getDefaultCipherSuites()

Returns the list of cipher suites which are enabled by default.

abstract String[] getSupportedCipherSuites()

Returns the names of the cipher suites which could be enabled for use on an SSL connection created by this factory.

Inherited methods

abstract ServerSocket createServerSocket(int port)

Returns a server socket bound to the specified port.

ServerSocket createServerSocket()

Returns an unbound server socket.

abstract ServerSocket createServerSocket(int port, int backlog, InetAddress ifAddress)

Returns a server socket bound to the specified port, with a specified listen backlog and local IP.

abstract ServerSocket createServerSocket(int port, int backlog)

Returns a server socket bound to the specified port, and uses the specified connection backlog.

static ServerSocketFactory getDefault()

Returns a copy of the environment's default socket factory.

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Protected constructors

SSLServerSocketFactory

Added in API level 1
protected SSLServerSocketFactory ()

Constructor is used only by subclasses.

Public methods

getDefault

Added in API level 1
public static ServerSocketFactory getDefault ()

Returns the default SSL server socket factory.

The first time this method is called, the security property "ssl.ServerSocketFactory.provider" is examined. If it is non-null, a class by that name is loaded and instantiated. If that is successful and the object is an instance of SSLServerSocketFactory, it is made the default SSL server socket factory.

Otherwise, this method returns SSLContext.getDefault().getServerSocketFactory(). If that call fails, an inoperative factory is returned.

Returns
ServerSocketFactory the default ServerSocketFactory

getDefaultCipherSuites

Added in API level 1
public abstract String[] getDefaultCipherSuites ()

Returns the list of cipher suites which are enabled by default. Unless a different list is enabled, handshaking on an SSL connection will use one of these cipher suites. The minimum quality of service for these defaults requires confidentiality protection and server authentication (that is, no anonymous cipher suites).

Returns
String[] array of the cipher suites enabled by default

getSupportedCipherSuites

Added in API level 1
public abstract String[] getSupportedCipherSuites ()

Returns the names of the cipher suites which could be enabled for use on an SSL connection created by this factory. 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.

Applications should not blindly enable all supported cipher suites. The supported cipher suites can include signaling cipher suite values that can cause connection problems if enabled inappropriately.

The proper way to use this method is to either check if a specific cipher suite is supported via Arrays.asList(getSupportedCipherSuites()).contains(...) or to filter a desired list of cipher suites to only the supported ones via desiredSuiteSet.retainAll(Arrays.asList(getSupportedCipherSuites())).

Returns
String[] an array of cipher suite names