# SSLContext

public class **SSLContext** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
Instances of this class represent a secure socket protocol
implementation which acts as a factory for secure socket
factories or `SSLEngine`s. This class is initialized
with an optional set of key and trust managers and source of
secure random bytes.

Android provides the following `SSLContext` protocols:

| Name | Supported (API Levels) |
|---|---|
| Default | 10+ |
| SSL | 10+ |
| SSLv3 | 10+ |
| TLS | 1+ |
| TLSv1 | 10+ |
| TLSv1.1 | 16+ |
| TLSv1.2 | 16+ |

This protocol is described in the [SSLContext section](https://developers.google.com/j2objc/javadoc/jre/openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SSLContext) of the Java Cryptography Architecture Standard Algorithm Name Documentation.

<br />

### Protected Constructor Summary

|---|---|
|   | [SSLContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#SSLContext(javax.net.ssl.SSLContextSpi,%20java.security.Provider,%20java.lang.String))([SSLContextSpi](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContextSpi.html) contextSpi, [Provider](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Provider.html) provider, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) protocol) Creates an SSLContext object. |

### Public Method Summary

|---|---|
| final [SSLEngine](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngine.html) | [createSSLEngine](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#createSSLEngine())() Creates a new `SSLEngine` using this context. |
| final [SSLEngine](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngine.html) | [createSSLEngine](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#createSSLEngine(java.lang.String,%20int))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) peerHost, int peerPort) Creates a new `SSLEngine` using this context using advisory peer information. |
| final [SSLSessionContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSessionContext.html) | [getClientSessionContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getClientSessionContext())() Returns the client session context, which represents the set of SSL sessions available for use during the handshake phase of client-side SSL sockets. |
| synchronized static [SSLContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html) | [getDefault](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getDefault())() Returns the default SSL context. |
| final [SSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html) | [getDefaultSSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getDefaultSSLParameters())() Returns a copy of the SSLParameters indicating the default settings for this SSL context. |
| static [SSLContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html) | [getInstance](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getInstance(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) protocol) Returns a `SSLContext` object that implements the specified secure socket protocol. |
| static [SSLContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html) | [getInstance](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getInstance(java.lang.String,%20java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) protocol, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) provider) Returns a `SSLContext` object that implements the specified secure socket protocol. |
| static [SSLContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html) | [getInstance](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getInstance(java.lang.String,%20java.security.Provider))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) protocol, [Provider](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Provider.html) provider) Returns a `SSLContext` object that implements the specified secure socket protocol. |
| final [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getProtocol](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getProtocol())() Returns the protocol name of this `SSLContext` object. |
| final [Provider](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Provider.html) | [getProvider](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getProvider())() Returns the provider of this `SSLContext` object. |
| final [SSLSessionContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSessionContext.html) | [getServerSessionContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getServerSessionContext())() Returns the server session context, which represents the set of SSL sessions available for use during the handshake phase of server-side SSL sockets. |
| final [SSLServerSocketFactory](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocketFactory.html) | [getServerSocketFactory](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getServerSocketFactory())() Returns a `ServerSocketFactory` object for this context. |
| final [SSLSocketFactory](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocketFactory.html) | [getSocketFactory](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getSocketFactory())() Returns a `SocketFactory` object for this context. |
| final [SSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html) | [getSupportedSSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getSupportedSSLParameters())() Returns a copy of the SSLParameters indicating the supported settings for this SSL context. |
| final void | [init](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#init(javax.net.ssl.KeyManager[],%20javax.net.ssl.TrustManager[],%20java.security.SecureRandom))([KeyManager\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/KeyManager.html) km, [TrustManager\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/TrustManager.html) tm, [SecureRandom](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureRandom.html) random) Initializes this context. |
| synchronized static void | [setDefault](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#setDefault(javax.net.ssl.SSLContext))([SSLContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html) context) Sets the default SSL context. |

### Inherited Method Summary

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. |

## Protected Constructors

#### protected
**SSLContext**
([SSLContextSpi](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContextSpi.html) contextSpi, [Provider](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Provider.html) provider, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) protocol)

Creates an SSLContext object.

##### Parameters

| contextSpi | the delegate |
| provider | the provider |
| protocol | the protocol |
|---|---|

## Public Methods

#### public final [SSLEngine](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngine.html)
**createSSLEngine**
()

Creates a new `SSLEngine` using this context.


Applications using this factory method are providing no hints
for an internal session reuse strategy. If hints are desired,
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#createSSLEngine(java.lang.String,%20int)` should be used
instead.


Some cipher suites (such as Kerberos) require remote hostname
information, in which case this factory method should not be used.

##### Returns

- the `SSLEngine` object

##### Throws

| [UnsupportedOperationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnsupportedOperationException.html) | if the underlying provider does not implement the operation. |
| [IllegalStateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalStateException.html) | if the SSLContextImpl requires initialization and the `init()` has not been called |
|---|---|

#### public final [SSLEngine](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngine.html)
**createSSLEngine**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) peerHost, int peerPort)

Creates a new `SSLEngine` using this context using
advisory peer information.


Applications using this factory method are providing hints
for an internal session reuse strategy.


Some cipher suites (such as Kerberos) require remote hostname
information, in which case peerHost needs to be specified.

##### Parameters

| peerHost | the non-authoritative name of the host |
| peerPort | the non-authoritative port |
|---|---|

##### Returns

- the new `SSLEngine` object

##### Throws

| [UnsupportedOperationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnsupportedOperationException.html) | if the underlying provider does not implement the operation. |
| [IllegalStateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalStateException.html) | if the SSLContextImpl requires initialization and the `init()` has not been called |
|---|---|

#### public final [SSLSessionContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSessionContext.html)
**getClientSessionContext**
()

Returns the client session context, which represents the set of
SSL sessions available for use during the handshake phase of
client-side SSL sockets.


This context may be unavailable in some environments, in which
case this method returns null. For example, when the underlying
SSL provider does not provide an implementation of SSLSessionContext
interface, this method returns null. A non-null session context
is returned otherwise.

##### Returns

- client session context bound to this SSL context

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

Returns the default SSL context.

If a default context was set using the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#setDefault(javax.net.ssl.SSLContext)` method, it is returned. Otherwise, the first
call of this method triggers the call
`SSLContext.getInstance("Default")`.
If successful, that object is made the default SSL context and returned.

The default context is immediately
usable and does not require {@linkplain #init initialization}.

##### Returns

- the default SSL context

##### Throws

| [NoSuchAlgorithmException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/NoSuchAlgorithmException.html) | if the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getInstance(java.lang.String)` call fails |
|---|---|

#### public final [SSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html)
**getDefaultSSLParameters**
()

Returns a copy of the SSLParameters indicating the default
settings for this SSL context.

The parameters will always have the ciphersuites and protocols
arrays set to non-null values.

##### Returns

- a copy of the SSLParameters object with the default settings

##### Throws

| [UnsupportedOperationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnsupportedOperationException.html) | if the default SSL parameters could not be obtained. |
|---|---|

#### public static [SSLContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html)
**getInstance**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) protocol)

Returns a `SSLContext` object that implements the
specified secure socket protocol.

This method traverses the list of registered security Providers,
starting with the most preferred Provider.
A new SSLContext object encapsulating the
SSLContextSpi implementation from the first
Provider that supports the specified protocol is returned.

Note that the list of registered providers may be retrieved via
the `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Security.html#getProviders()` method.

##### Parameters

| protocol | the standard name of the requested protocol. See the SSLContext section in the [Java Cryptography Architecture Standard Algorithm Name Documentation](https://developers.google.com/j2objc/javadoc/jre/openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SSLContext) for information about standard protocol names. |
|---|---|

##### Returns

- the new `SSLContext` object.

##### Throws

| [NoSuchAlgorithmException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/NoSuchAlgorithmException.html) | if no Provider supports a TrustManagerFactorySpi implementation for the specified protocol. |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if protocol is null. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Provider.html`

#### public static [SSLContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html)
**getInstance**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) protocol, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) provider)

Returns a `SSLContext` object that implements the
specified secure socket protocol.

A new SSLContext object encapsulating the
SSLContextSpi implementation from the specified provider
is returned. The specified provider must be registered
in the security provider list.

Note that the list of registered providers may be retrieved via
the `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Security.html#getProviders()` method.

##### Parameters

| protocol | the standard name of the requested protocol. See the SSLContext section in the [Java Cryptography Architecture Standard Algorithm Name Documentation](https://developers.google.com/j2objc/javadoc/jre/openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SSLContext) for information about standard protocol names. |
| provider | the name of the provider. |
|---|---|

##### Returns

- the new `SSLContext` object.

##### Throws

| [NoSuchAlgorithmException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/NoSuchAlgorithmException.html) | if a SSLContextSpi implementation for the specified protocol is not available from the specified provider. |
| [NoSuchProviderException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/NoSuchProviderException.html) | if the specified provider is not registered in the security provider list. |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if the provider name is null or empty. |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if protocol is null. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Provider.html`

#### public static [SSLContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html)
**getInstance**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) protocol, [Provider](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Provider.html) provider)

Returns a `SSLContext` object that implements the
specified secure socket protocol.

A new SSLContext object encapsulating the
SSLContextSpi implementation from the specified Provider
object is returned. Note that the specified Provider object
does not have to be registered in the provider list.

##### Parameters

| protocol | the standard name of the requested protocol. See the SSLContext section in the [Java Cryptography Architecture Standard Algorithm Name Documentation](https://developers.google.com/j2objc/javadoc/jre/openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SSLContext) for information about standard protocol names. |
| provider | an instance of the provider. |
|---|---|

##### Returns

- the new `SSLContext` object.

##### Throws

| [NoSuchAlgorithmException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/NoSuchAlgorithmException.html) | if a KeyManagerFactorySpi implementation for the specified protocol is not available from the specified Provider object. |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if the provider name is null. |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if protocol is null. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Provider.html`

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

Returns the protocol name of this `SSLContext` object.

This is the same name that was specified in one of the
`getInstance` calls that created this
`SSLContext` object.

##### Returns

- the protocol name of this `SSLContext` object.

#### public final [Provider](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Provider.html)
**getProvider**
()

Returns the provider of this `SSLContext` object.

##### Returns

- the provider of this `SSLContext` object

#### public final [SSLSessionContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSessionContext.html)
**getServerSessionContext**
()

Returns the server session context, which represents the set of
SSL sessions available for use during the handshake phase of
server-side SSL sockets.


This context may be unavailable in some environments, in which
case this method returns null. For example, when the underlying
SSL provider does not provide an implementation of SSLSessionContext
interface, this method returns null. A non-null session context
is returned otherwise.

##### Returns

- server session context bound to this SSL context

#### public final [SSLServerSocketFactory](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLServerSocketFactory.html)
**getServerSocketFactory**
()

Returns a `ServerSocketFactory` object for
this context.

##### Returns

- the `ServerSocketFactory` object

##### Throws

| [IllegalStateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalStateException.html) | if the SSLContextImpl requires initialization and the `init()` has not been called |
|---|---|

#### public final [SSLSocketFactory](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLSocketFactory.html)
**getSocketFactory**
()

Returns a `SocketFactory` object for this
context.

##### Returns

- the `SocketFactory` object

##### Throws

| [IllegalStateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalStateException.html) | if the SSLContextImpl requires initialization and the `init()` has not been called |
|---|---|

#### public final [SSLParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLParameters.html)
**getSupportedSSLParameters**
()

Returns a copy of the SSLParameters indicating the supported
settings for this SSL context.

The parameters will always have the ciphersuites and protocols
arrays set to non-null values.

##### Returns

- a copy of the SSLParameters object with the supported settings

##### Throws

| [UnsupportedOperationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnsupportedOperationException.html) | if the supported SSL parameters could not be obtained. |
|---|---|

#### public final void
**init**
([KeyManager\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/KeyManager.html) km, [TrustManager\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/TrustManager.html) tm, [SecureRandom](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureRandom.html) random)

Initializes this context. Either of the first two parameters
may be null in which case the installed security providers will
be searched for the highest priority implementation of the
appropriate factory. Likewise, the secure random parameter may
be null in which case the default implementation will be used.


Only the first instance of a particular key and/or trust manager
implementation type in the array is used. (For example, only
the first javax.net.ssl.X509KeyManager in the array will be used.)

##### Parameters

| km | the sources of authentication keys or null |
| tm | the sources of peer authentication trust decisions or null |
| random | the source of randomness for this generator or null |
|---|---|

##### Throws

| [KeyManagementException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/KeyManagementException.html) | if this operation fails |
|---|---|

#### public static synchronized void
**setDefault**
([SSLContext](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html) context)

Sets the default SSL context. It will be returned by subsequent calls
to `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLContext.html#getDefault()`. The default context must be immediately usable
and not require {@linkplain #init initialization}.

##### Parameters

| context | the SSLContext |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if context is null |
| [SecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityException.html) | if a security manager exists and its `checkPermission` method does not allow `SSLPermission("setDefaultSSLContext")` |
|---|---|