Package org.mariadb.jdbc.plugin

## Interface TlsSocketPlugin

All Known Implementing Classes:
  `DefaultTlsSocketPlugin`

    public interface TlsSocketPlugin

TLS Socket interface plugin

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`default SSLSocket` `createSocket​(Socket socket, SSLSocketFactory sslSocketFactory)` Returns a socket layered over an existing socket negotiating the use of SSL over an existing socket.
`SSLSocketFactory` `getSocketFactory​(Configuration conf, ExceptionFactory exceptionFactory)` Get socket factory.
`String` `type()` plugin type.
`void` `verify​(String host, SSLSession sslSession, long serverThreadId)` Host name verifier implementation.

### Method Detail

#### type

    String type()

plugin type.

Returns:
  plugin type

#### getSocketFactory

    SSLSocketFactory getSocketFactory​(Configuration conf,
                                      ExceptionFactory exceptionFactory)
                               throws SQLException

Get socket factory.

Parameters:
  `conf` - connection string option. Non-standard option are stored in `nonMappedOptions` if any specific option is needed.
  `exceptionFactory` - exception handler
Returns:
  custom SSL socket factory
Throws:
  `SQLException` - if socket factory configuration failed.

#### createSocket

    default SSLSocket createSocket​(Socket socket,
                                   SSLSocketFactory sslSocketFactory)
                            throws IOException

Returns a socket layered over an existing socket negotiating the use of SSL over an existing socket.

Parameters:
  `socket` - existing socket
  `sslSocketFactory` - SSL socket factory
Returns:
  SSL socket
Throws:
  `IOException` - if any socket error occurs.

#### verify

    void verify​(String host,
                SSLSession sslSession,
                long serverThreadId)
         throws SSLException

Host name verifier implementation.

Parameters:
  `host` - hostname
  `sslSession` - ssl session
  `serverThreadId` - current server threadId
Throws:
  `SSLException` - if verification fail