# SSLSocketFactory

public abstract class **SSLSocketFactory** extends [SocketFactory](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/SocketFactory.html)  
`SSLSocketFactory`s create `SSLSocket`s.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocket.html`

### Public Constructor Summary

|---|---|
|   | [SSLSocketFactory](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocketFactory.html#SSLSocketFactory())() Constructor is used only by subclasses. |

### Public Method Summary

|---|---|
| abstract [Socket](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/Socket.html) | [createSocket](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocketFactory.html#createSocket(java.net.Socket,%20java.lang.String,%20int,%20boolean))([Socket](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/Socket.html) s, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) host, int port, boolean autoClose) Returns a socket layered over an existing socket connected to the named host, at the given port. |
| synchronized static [SocketFactory](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/SocketFactory.html) | [getDefault](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocketFactory.html#getDefault())() Returns the default SSL socket factory. |
| abstract [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getDefaultCipherSuites](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocketFactory.html#getDefaultCipherSuites())() Returns the list of cipher suites which are enabled by default. |
| abstract [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getSupportedCipherSuites](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocketFactory.html#getSupportedCipherSuites())() Returns the names of the cipher suites which could be enabled for use on an SSL connection. |

### Inherited Method Summary

From class [javax.net.SocketFactory](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/SocketFactory.html)

|---|---|
| abstract [Socket](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/Socket.html) | [createSocket](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/SocketFactory.html#createSocket(java.lang.String,%20int))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) host, int port) Creates a socket and connects it to the specified remote host at the specified remote port. |
| abstract [Socket](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/Socket.html) | [createSocket](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/SocketFactory.html#createSocket(java.net.InetAddress,%20int))([InetAddress](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/InetAddress.html) host, int port) Creates a socket and connects it to the specified port number at the specified address. |
| abstract [Socket](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/Socket.html) | [createSocket](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/SocketFactory.html#createSocket(java.net.InetAddress,%20int,%20java.net.InetAddress,%20int))([InetAddress](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/InetAddress.html) address, int port, [InetAddress](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/InetAddress.html) localAddress, int localPort) Creates a socket and connect it to the specified remote address on the specified remote port. |
| abstract [Socket](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/Socket.html) | [createSocket](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/SocketFactory.html#createSocket(java.lang.String,%20int,%20java.net.InetAddress,%20int))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) host, int port, [InetAddress](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/InetAddress.html) localHost, int localPort) Creates a socket and connects it to the specified remote host on the specified remote port. |
| [Socket](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/Socket.html) | [createSocket](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/SocketFactory.html#createSocket())() Creates an unconnected socket. |
| static [SocketFactory](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/SocketFactory.html) | [getDefault](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/SocketFactory.html#getDefault())() Returns a copy of the environment's default socket factory. |

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Constructors

#### public
**SSLSocketFactory**
()

Constructor is used only by subclasses.

## Public Methods

#### public abstract [Socket](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/Socket.html)
**createSocket**
([Socket](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/Socket.html) s, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) host, int port, boolean autoClose)

Returns a socket layered over an existing socket connected to the named
host, at the given port. This constructor can be used when tunneling SSL
through a proxy or when negotiating the use of SSL over an existing
socket. The host and port refer to the logical peer destination.
This socket is configured using the socket options established for
this factory.

##### Parameters

| s | the existing socket |
| host | the server host |
| port | the server port |
| autoClose | close the underlying socket when this socket is closed |
|---|---|

##### Returns

- a socket connected to the specified host and port

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error occurs when creating the socket |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if the parameter s is null |
|---|---|

#### public static synchronized [SocketFactory](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/SocketFactory.html)
**getDefault**
()

Returns the default SSL socket factory.

The first time this method is called, the security property
"ssl.SocketFactory.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 SSLSocketFactory, it is made the default SSL
socket factory.

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

##### Returns

- the default `SocketFactory`

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getDefault()`

#### public abstract [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**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

- array of the cipher suites enabled by default

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocketFactory.html#getSupportedCipherSuites()`

#### public abstract [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**getSupportedCipherSuites**
()

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

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocketFactory.html#getDefaultCipherSuites()`