org.keycloak.truststore

## Class SSLSocketFactory

- java.lang.Object
- - javax.net.SocketFactory
  - - javax.net.ssl.SSLSocketFactory
    - - org.keycloak.truststore.SSLSocketFactory

-     public class SSLSocketFactory
      extends SSLSocketFactory

  Using this class is ugly, but it is the only way to push our truststore to the default LDAP client implementation.

  This SSLSocketFactory can only use truststore configured by TruststoreProvider after the ProviderFactory was initialized using standard Spi load / init mechanism. That will only happen if "truststore" provider is configured in standalone.xml or domain.xml.

  If TruststoreProvider is not available this SSLSocketFactory will delegate all operations to javax.net.ssl.SSLSocketFactory.getDefault().

  Author:
    Marko Strukelj

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Socket` | `createSocket()`
    `Socket` | `createSocket(InetAddress host, int port)`
    `Socket` | `createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)`
    `Socket` | `createSocket(Socket socket, String host, int port, boolean autoClose)`
    `Socket` | `createSocket(String host, int port)`
    `Socket` | `createSocket(String host, int port, InetAddress localHost, int localPort)`
    `static SSLSocketFactory` | `getDefault()`
    `String[]` | `getDefaultCipherSuites()`
    `String[]` | `getSupportedCipherSuites()`

    - ### Methods inherited from class javax.net.ssl.SSLSocketFactory

      `createSocket`

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

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

- - ### Method Detail

    - #### getDefault

          public static SSLSocketFactory getDefault()

    - #### getDefaultCipherSuites

          public String[] getDefaultCipherSuites()

      Specified by:
        `getDefaultCipherSuites` in class `SSLSocketFactory`

    - #### getSupportedCipherSuites

          public String[] getSupportedCipherSuites()

      Specified by:
        `getSupportedCipherSuites` in class `SSLSocketFactory`

    - #### createSocket

          public Socket createSocket(Socket socket,
                                     String host,
                                     int port,
                                     boolean autoClose)
                              throws IOException

      Specified by:
        `createSocket` in class `SSLSocketFactory`
      Throws:
        `IOException`

    - #### createSocket

          public Socket createSocket(String host,
                                     int port)
                              throws IOException

      Specified by:
        `createSocket` in class `SocketFactory`
      Throws:
        `IOException`

    - #### createSocket

          public Socket createSocket(String host,
                                     int port,
                                     InetAddress localHost,
                                     int localPort)
                              throws IOException

      Specified by:
        `createSocket` in class `SocketFactory`
      Throws:
        `IOException`

    - #### createSocket

          public Socket createSocket(InetAddress host,
                                     int port)
                              throws IOException

      Specified by:
        `createSocket` in class `SocketFactory`
      Throws:
        `IOException`

    - #### createSocket

          public Socket createSocket(InetAddress address,
                                     int port,
                                     InetAddress localAddress,
                                     int localPort)
                              throws IOException

      Specified by:
        `createSocket` in class `SocketFactory`
      Throws:
        `IOException`

    - #### createSocket

          public Socket createSocket()
                              throws IOException

      Overrides:
        `createSocket` in class `SocketFactory`
      Throws:
        `IOException`

Copyright © 2020 JBoss by Red Hat. All rights reserved.