com.verisign.epp.transport.client

## Class EPPSSLClientSocket

- java.lang.Object
- - com.verisign.epp.transport.client.EPPSSLClientSocket

- All Implemented Interfaces:
    EPPClientCon
  Direct Known Subclasses:
    EPPSSLProxyClientSocket

      public class EPPSSLClientSocket
      extends java.lang.Object
      implements EPPClientCon

  Secure Socket Layer client socket class that can be configured to connect to a server over SSL / TLS using the `EPP.ClientSocketName` configuration property. The SSL settings are passed into the `EPPSSLClientSocket` class using the `EPPSSLContext` class.
  See Also:
    `EPPSSLContext`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EPPSSLClientSocket()` Default constructor that gets the following settings from `EPPEnv`: `hostName` - Defined with the `EPPEnv.getServerName()` method.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closing the connection.
    `protected java.lang.String` | `getClientHostName()` Gets the client host name to use for the connection.
    `protected int` | `getConTimeout()` Gets the connection timeout setting.
    `protected java.lang.String` | `getHostName()` Gets the host name or IP address to connect to.
    `java.io.InputStream` | `getInputStream()` Gets the input stream of the `Socket` connection.
    `java.io.OutputStream` | `getOutputStream()` Gets the output stream of the `Socket` connection.
    `protected int` | `getPortNumber()` Gets the port number to connect to.
    `protected javax.net.ssl.SSLSocket` | `getSocket()` Gets the enclosing `SSLSocket` of the connection.
    `protected EPPSSLContext` | `getSslContext()` Gets the `EPPSSLContext` to use for the SSL connection.
    `protected java.lang.String` | `getSSLPropertyListString(java.lang.String[] aList)` Gets an SSL property list as a string for logging purposes.
    `void` | `initialize()` Initializes an SSL connection to the host and port defined by the server name and the server port properties of `EPPEnv`.
    `void` | `initialize(java.lang.String aHostName, int aPortNumber, EPPSSLContext aSSLContext)` Initializes a SSL connection to a specific host and port.
    `void` | `initialize(java.lang.String aHostName, int aPortNumber, java.lang.String aClientHostName, EPPSSLContext aSSLContext)` Initializes a SSL connection to a specific host and port.
    `protected boolean` | `isConnected()` Is the connection established?
    `protected void` | `setClientHostName(java.lang.String aClientHostName)` Sets the client host name to use for the connection.
    `protected void` | `setConnected(boolean aIsConnected)` Sets whether the connection is established.
    `protected void` | `setConTimeout(int aConTimeout)` Sets the connection timeout setting.
    `protected void` | `setHostName(java.lang.String aHostName)` Sets the host name or IP address to connect to.
    `protected void` | `setInputStream(java.io.InputStream aInputStream)` Sets the input stream of the `Socket` connection.
    `protected void` | `setOutputStream(java.io.OutputStream aOutputStream)` Sets the output stream of the `Socket` connection.
    `protected void` | `setPortNumber(int aPortNumber)` Sets the port number to connect to.
    `protected void` | `setSocket(javax.net.ssl.SSLSocket aSocket)` Sets the `SSLSocket` to use.
    `protected void` | `setSslContext(EPPSSLContext aSslContext)` Sets the `EPPSSLContext` to use for the SSL connection

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

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

- - ### Constructor Detail

    - #### EPPSSLClientSocket

          public EPPSSLClientSocket()
                             throws EPPConException

      Default constructor that gets the following settings from `EPPEnv`:
      - `hostName` - Defined with the `EPPEnv.getServerName()` method.
      - `portNumber` - Defined with the `EPPEnv.getServerPort()` method.
      - `conTimeout` - Defined with the `EPPEnv.getConTimeOut()` method.
      - `clientHostName` - Defined with the `EPPEnv.getClientHost()` method.
      Throws:
        `EPPConException` - If there is a problem getting the default connection properties from `EPPEnv`.

  - ### Method Detail

    - #### initialize

          public void initialize()
                          throws EPPConException

      Initializes an SSL connection to the host and port defined by the server name and the server port properties of `EPPEnv`.
      Specified by:
        `initialize` in interface `EPPClientCon`
      Throws:
        `EPPConException` - Error initializing the connection.

    - #### initialize

          public void initialize(java.lang.String aHostName,
                                 int aPortNumber,
                                 EPPSSLContext aSSLContext)
                          throws EPPConException

      Initializes a SSL connection to a specific host and port. There remainder of the connection settings is derived from the `EPPEnv` properties.
      Specified by:
        `initialize` in interface `EPPClientCon`
      Parameters:
        `aHostName` - Host name or IP address of host to connect to
        `aPortNumber` - Port number to connect to
        `aSSLContext` - Optional specific SSL context to use
      Throws:
        `EPPConException` - Error initializing the connection.

    - #### initialize

          public void initialize(java.lang.String aHostName,
                                 int aPortNumber,
                                 java.lang.String aClientHostName,
                                 EPPSSLContext aSSLContext)
                          throws EPPConException

      Initializes a SSL connection to a specific host and port. There remainder of the connection settings is derived from the `EPPEnv` properties.
      Specified by:
        `initialize` in interface `EPPClientCon`
      Parameters:
        `aHostName` - Host name or IP address of host to connect to
        `aPortNumber` - Port number to connect to
        `aClientHostName` - Host name or IP address to connect from
        `aSSLContext` - Optional specific SSL context to use
      Throws:
        `EPPConException` - Error initializing the connection.

    - #### getInputStream

          public java.io.InputStream getInputStream()
                                             throws EPPConException

      Gets the input stream of the `Socket` connection.
      Specified by:
        `getInputStream` in interface `EPPClientCon`
      Returns:
        `InputStream` of the connected `Socket`
      Throws:
        `EPPConException` - Input stream not set

    - #### setInputStream

          protected void setInputStream(java.io.InputStream aInputStream)

      Sets the input stream of the `Socket` connection. This can only be set by a derived class to support tunneling and other extensions.
      Parameters:
        `aInputStream` - Input stream to set

    - #### getOutputStream

          public java.io.OutputStream getOutputStream()
                                               throws EPPConException

      Gets the output stream of the `Socket` connection.
      Specified by:
        `getOutputStream` in interface `EPPClientCon`
      Returns:
        `OutputStream` of the connected `Socket`
      Throws:
        `EPPConException` - Output stream not set

    - #### setOutputStream

          protected void setOutputStream(java.io.OutputStream aOutputStream)

      Sets the output stream of the `Socket` connection. This can only be set by a derived class to support tunneling and other extensions.
      Parameters:
        `aOutputStream` - Output stream to set

    - #### getSocket

          protected javax.net.ssl.SSLSocket getSocket()

      Gets the enclosing `SSLSocket` of the connection.
      Returns:
        Gets the enclosing `SSLSocket` if defined; `null` otherwise.

    - #### setSocket

          protected void setSocket(javax.net.ssl.SSLSocket aSocket)

      Sets the `SSLSocket` to use.
      Parameters:
        `aSocket` - `SSLSocket` to use

    - #### getSslContext

          protected EPPSSLContext getSslContext()

      Gets the `EPPSSLContext` to use for the SSL connection.
      Returns:
        `EPPSSLContext` to use

    - #### setSslContext

          protected void setSslContext(EPPSSLContext aSslContext)

      Sets the `EPPSSLContext` to use for the SSL connection
      Parameters:
        `aSslContext` - `EPPSSLContext` to use

    - #### getClientHostName

          protected java.lang.String getClientHostName()

      Gets the client host name to use for the connection.
      Returns:
        Client host name if set; `null` otherwise.

    - #### setClientHostName

          protected void setClientHostName(java.lang.String aClientHostName)

      Sets the client host name to use for the connection.
      Parameters:
        `aClientHostName` - Client host name to use

    - #### getHostName

          protected java.lang.String getHostName()

      Gets the host name or IP address to connect to.
      Returns:
        host name or IP address to connect to

    - #### setHostName

          protected void setHostName(java.lang.String aHostName)

      Sets the host name or IP address to connect to.
      Parameters:
        `aHostName` - Host name or IP address to connect to

    - #### getPortNumber

          protected int getPortNumber()

      Gets the port number to connect to.
      Returns:
        port number to connect to

    - #### setPortNumber

          protected void setPortNumber(int aPortNumber)

      Sets the port number to connect to.
      Parameters:
        `aPortNumber` - Port number to connect to

    - #### getConTimeout

          protected int getConTimeout()

      Gets the connection timeout setting.
      Returns:
        connection timeout

    - #### setConTimeout

          protected void setConTimeout(int aConTimeout)

      Sets the connection timeout setting.
      Parameters:
        `aConTimeout` - connection timeout

    - #### isConnected

          protected boolean isConnected()

      Is the connection established?
      Returns:
        `true` if connected; `false` otherwise.

    - #### setConnected

          protected void setConnected(boolean aIsConnected)

      Sets whether the connection is established.
      Parameters:
        `aIsConnected` - `true` if connected; `false` otherwise

    - #### close

          public void close()
                     throws EPPConException

      Closing the connection.
      Specified by:
        `close` in interface `EPPClientCon`
      Throws:
        `EPPConException` - Error closing the connection

    - #### getSSLPropertyListString

          protected java.lang.String getSSLPropertyListString(java.lang.String[] aList)

      Gets an SSL property list as a string for logging purposes. Examples of SSL property lists include supported protocols, enabled protocols, supported cipher suites, and enabled cipher suites.
      Parameters:
        `aList` - `Array` of `String`'s.
      Returns:
        Space delimited `String` representing the property list if `aList` is not `null`; `null` otherwise

Copyright © VeriSign Inc. All Rights Reserved.