org.apache.ignite.internal.client.ssl

## Class GridSslBasicContextFactory

- java.lang.Object
- - org.apache.ignite.internal.client.ssl.GridSslBasicContextFactory

All Implemented Interfaces:
  GridSslContextFactory

Deprecated.
Use `Factory` instead.

    @Deprecated
    public class GridSslBasicContextFactory
    extends Object
    implements GridSslContextFactory

Basic ssl context factory that provides ssl context configuration with specified key and trust stores.

In some cases it is useful to disable certificate validation of client side (e.g. when connecting to a server with self-signed certificate). This can be achieved by setting a disabled trust manager to this factory, which can be obtained by `getDisabledTrustManager()` method:

         GridSslBasicContextFactory factory = new GridSslBasicContextFactory();
         factory.setTrustManagers(GridSslBasicContextFactory.getDisabledTrustManager());
         // Rest of initialization.

### Field Summary

Fields
`static String` `DFLT_KEY_ALGORITHM` Deprecated. Default key manager algorithm.
`static String` `DFLT_SSL_PROTOCOL` Deprecated. Default SSL protocol.
`static String` `DFLT_STORE_TYPE` Deprecated. Default key store type.

### Constructor Summary

Constructors
Constructor and Description
`GridSslBasicContextFactory()` Deprecated.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
`SSLContext` `createSslContext()` Deprecated. Creates SSL context based on factory settings.
`static TrustManager` `getDisabledTrustManager()` Deprecated. Returns an instance of trust manager that will always succeed regardless of certificate provided.
`String` `getKeyAlgorithm()` Deprecated. Gets algorithm that will be used to create a key manager.
`String` `getKeyStoreFilePath()` Deprecated. Gets path to the key store file.
`char[]` `getKeyStorePassword()` Deprecated. Gets key store password.
`String` `getKeyStoreType()` Deprecated. Gets key store type used for context creation.
`String` `getProtocol()` Deprecated. Gets protocol for secure transport.
`TrustManager[]` `getTrustManagers()` Deprecated. Gets pre-configured trust managers.
`String` `getTrustStoreFilePath()` Deprecated. Gets path to the trust store file.
`char[]` `getTrustStorePassword()` Deprecated. Gets trust store password.
`String` `getTrustStoreType()` Deprecated. Gets trust store type used for context creation.
`protected InputStream` `openFileInputStream(String filePath)` Deprecated. By default, this method simply opens a raw file input stream.
`void` `setKeyAlgorithm(String keyAlgorithm)` Deprecated. Sets key manager algorithm that will be used to create a key manager.
`void` `setKeyStoreFilePath(String keyStoreFilePath)` Deprecated. Sets path to the key store file.
`void` `setKeyStorePassword(char[] keyStorePwd)` Deprecated. Sets key store password.
`void` `setKeyStoreType(String keyStoreType)` Deprecated. Sets key store type used in context initialization.
`void` `setProtocol(String proto)` Deprecated. Sets protocol for secure transport.
`void` `setTrustManagers(TrustManager... trustMgrs)` Deprecated. Sets pre-configured trust managers.
`void` `setTrustStoreFilePath(String trustStoreFilePath)` Deprecated. Sets path to the trust store file.
`void` `setTrustStorePassword(char[] trustStorePwd)` Deprecated. Sets trust store password.
`void` `setTrustStoreType(String trustStoreType)` Deprecated. Sets trust store type used in context initialization.
`String` `toString()` Deprecated.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### DFLT_STORE_TYPE

    public static final String DFLT_STORE_TYPE

Deprecated.
Default key store type.

See Also:
  Constant Field Values

#### DFLT_SSL_PROTOCOL

    public static final String DFLT_SSL_PROTOCOL

Deprecated.
Default SSL protocol.

See Also:
  Constant Field Values

#### DFLT_KEY_ALGORITHM

    public static final String DFLT_KEY_ALGORITHM

Deprecated.
Default key manager algorithm.

See Also:
  Constant Field Values

### Constructor Detail

#### GridSslBasicContextFactory

    public GridSslBasicContextFactory()

Deprecated.

### Method Detail

#### getKeyStoreType

    public String getKeyStoreType()

Deprecated.
Gets key store type used for context creation.

Returns:
  Key store type.

#### setKeyStoreType

    public void setKeyStoreType(String keyStoreType)

Deprecated.
Sets key store type used in context initialization. If not provided, `DFLT_STORE_TYPE` will be used.

Parameters:
  `keyStoreType` - Key store type.

#### getTrustStoreType

    public String getTrustStoreType()

Deprecated.
Gets trust store type used for context creation.

Returns:
  trust store type.

#### setTrustStoreType

    public void setTrustStoreType(String trustStoreType)

Deprecated.
Sets trust store type used in context initialization. If not provided, `DFLT_STORE_TYPE` will be used.

Parameters:
  `trustStoreType` - Trust store type.

#### getProtocol

    public String getProtocol()

Deprecated.
Gets protocol for secure transport.

Returns:
  SSL protocol name.

#### setProtocol

    public void setProtocol(String proto)

Deprecated.
Sets protocol for secure transport. If not specified, `DFLT_SSL_PROTOCOL` will be used.

Parameters:
  `proto` - SSL protocol name.

#### getKeyAlgorithm

    public String getKeyAlgorithm()

Deprecated.
Gets algorithm that will be used to create a key manager. If not specified, `DFLT_KEY_ALGORITHM` will be used.

Returns:
  Key manager algorithm.

#### setKeyAlgorithm

    public void setKeyAlgorithm(String keyAlgorithm)

Deprecated.
Sets key manager algorithm that will be used to create a key manager. Notice that in most cased default value suites well, however, on Android platform this value need to be set to `X509``.`

Parameters:
  `keyAlgorithm` - Key algorithm name.

#### getKeyStoreFilePath

    public String getKeyStoreFilePath()

Deprecated.
Gets path to the key store file.

Returns:
  Path to key store file.

#### setKeyStoreFilePath

    public void setKeyStoreFilePath(String keyStoreFilePath)

Deprecated.
Sets path to the key store file. This is a mandatory parameter since ssl context could not be initialized without key manager.

Parameters:
  `keyStoreFilePath` - Path to key store file.

#### getKeyStorePassword

    public char[] getKeyStorePassword()

Deprecated.
Gets key store password.

Returns:
  Key store password.

#### setKeyStorePassword

    public void setKeyStorePassword(char[] keyStorePwd)

Deprecated.
Sets key store password.

Parameters:
  `keyStorePwd` - Key store password.

#### getTrustStoreFilePath

    public String getTrustStoreFilePath()

Deprecated.
Gets path to the trust store file.

Returns:
  Path to the trust store file.

#### setTrustStoreFilePath

    public void setTrustStoreFilePath(String trustStoreFilePath)

Deprecated.
Sets path to the trust store file. This is an optional parameter, however one of the `setTrustStoreFilePath(String)`, `setTrustManagers(TrustManager[])` properties must be set.

Parameters:
  `trustStoreFilePath` - Path to the trust store file.

#### getTrustStorePassword

    public char[] getTrustStorePassword()

Deprecated.
Gets trust store password.

Returns:
  Trust store password.

#### setTrustStorePassword

    public void setTrustStorePassword(char[] trustStorePwd)

Deprecated.
Sets trust store password.

Parameters:
  `trustStorePwd` - Trust store password.

#### getTrustManagers

    public TrustManager[] getTrustManagers()

Deprecated.
Gets pre-configured trust managers.

Returns:
  Trust managers.

#### setTrustManagers

    public void setTrustManagers(TrustManager... trustMgrs)

Deprecated.
Sets pre-configured trust managers. This is an optional parameter, however one of the `setTrustStoreFilePath(String)`, `#setTrustManagers(TrustManager[])`

Parameters:
  `trustMgrs` - Pre-configured trust managers.

#### getDisabledTrustManager

    public static TrustManager getDisabledTrustManager()

Deprecated.
Returns an instance of trust manager that will always succeed regardless of certificate provided.

Returns:
  Trust manager instance.

#### createSslContext

    public SSLContext createSslContext()
                                throws SSLException

Deprecated.
Creates SSL context based on factory settings.

Specified by:
  `createSslContext` in interface `GridSslContextFactory`
Returns:
  Initialized SSL context.
Throws:
  `SSLException` - If SSL context could not be created.

#### openFileInputStream

    protected InputStream openFileInputStream(String filePath)
                                       throws IOException

Deprecated.
By default, this method simply opens a raw file input stream. Subclasses may override this method if some specific location should be handled (this may be a case for Android users).

Parameters:
  `filePath` - Path to the file.
Returns:
  Opened input stream.
Throws:
  `IOException` - If stream could not be opened.

#### toString

    public String toString()

Deprecated.

Overrides:
  `toString` in class `Object`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.5
Release Date | : June 4 2019