Class EPPSSLClientSocket
java.lang.Object
com.verisign.epp.transport.client.EPPSSLClientSocket
- All Implemented Interfaces:
EPPClientCon
- Direct Known Subclasses:
EPPSSLProxyClientSocket
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:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor that gets the following settings fromEPPEnv:
hostName- Defined with theEPPEnv.getServerName()method. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closing the connection.Gets the client host name to use for the connection.intGets the connection timeout setting.Gets the host name or IP address to connect to.Gets the input stream of theSocketconnection.Gets the output stream of theSocketconnection.intGets the port number to connect to.Gets the enclosingSSLSocketof the connection.Gets theEPPSSLContextto use for the SSL connection.protected StringgetSSLPropertyListString(String[] aList) Gets an SSL property list as a string for logging purposes.voidInitializes an SSL connection to the host and port defined by the server name and the server port properties ofEPPEnv.voidinitialize(String aHostName, int aPortNumber, EPPSSLContext aSSLContext) Initializes a SSL connection to a specific host and port.voidinitialize(String aHostName, int aPortNumber, String aClientHostName, EPPSSLContext aSSLContext) Initializes a SSL connection to a specific host and port.booleanIs the connection established?protected voidsetClientHostName(String aClientHostName) Sets the client host name to use for the connection.protected voidsetConnected(boolean aIsConnected) Sets whether the connection is established.protected voidsetConTimeout(int aConTimeout) Sets the connection timeout setting.protected voidsetHostName(String aHostName) Sets the host name or IP address to connect to.protected voidsetInputStream(InputStream aInputStream) Sets the input stream of theSocketconnection.protected voidsetOutputStream(OutputStream aOutputStream) Sets the output stream of theSocketconnection.protected voidsetPortNumber(int aPortNumber) Sets the port number to connect to.protected voidSets theSSLSocketto use.protected voidsetSslContext(EPPSSLContext aSslContext) Sets theEPPSSLContextto use for the SSL connection
-
Constructor Details
-
EPPSSLClientSocket
Default constructor that gets the following settings fromEPPEnv:
hostName- Defined with theEPPEnv.getServerName()method.portNumber- Defined with theEPPEnv.getServerPort()method.conTimeout- Defined with theEPPEnv.getConTimeOut()method.readTimeout- Defined with theEPPEnv.getReadTimeOut()method.clientHostName- Defined with theEPPEnv.getClientHost()method.
- Throws:
EPPConException- If there is a problem getting the default connection properties fromEPPEnv.
-
-
Method Details
-
initialize
Initializes an SSL connection to the host and port defined by the server name and the server port properties ofEPPEnv.- Specified by:
initializein interfaceEPPClientCon- Throws:
EPPConException- Error initializing the connection.
-
initialize
public void initialize(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 theEPPEnvproperties.- Specified by:
initializein interfaceEPPClientCon- Parameters:
aHostName- Host name or IP address of host to connect toaPortNumber- Port number to connect toaSSLContext- Optional specific SSL context to use- Throws:
EPPConException- Error initializing the connection.
-
initialize
public void initialize(String aHostName, int aPortNumber, 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 theEPPEnvproperties.- Specified by:
initializein interfaceEPPClientCon- Parameters:
aHostName- Host name or IP address of host to connect toaPortNumber- Port number to connect toaClientHostName- Host name or IP address to connect fromaSSLContext- Optional specific SSL context to use- Throws:
EPPConException- Error initializing the connection.
-
getInputStream
Gets the input stream of theSocketconnection.- Specified by:
getInputStreamin interfaceEPPClientCon- Returns:
InputStreamof the connectedSocket- Throws:
EPPConException- Input stream not set
-
setInputStream
Sets the input stream of theSocketconnection. This can only be set by a derived class to support tunneling and other extensions.- Parameters:
aInputStream- Input stream to set
-
getOutputStream
Gets the output stream of theSocketconnection.- Specified by:
getOutputStreamin interfaceEPPClientCon- Returns:
OutputStreamof the connectedSocket- Throws:
EPPConException- Output stream not set
-
setOutputStream
Sets the output stream of theSocketconnection. This can only be set by a derived class to support tunneling and other extensions.- Parameters:
aOutputStream- Output stream to set
-
getSocket
Gets the enclosingSSLSocketof the connection.- Returns:
- Gets the enclosing
SSLSocketif defined;nullotherwise.
-
setSocket
Sets theSSLSocketto use.- Parameters:
aSocket-SSLSocketto use
-
getSslContext
Gets theEPPSSLContextto use for the SSL connection.- Returns:
EPPSSLContextto use
-
setSslContext
Sets theEPPSSLContextto use for the SSL connection- Parameters:
aSslContext-EPPSSLContextto use
-
getClientHostName
Gets the client host name to use for the connection.- Returns:
- Client host name if set;
nullotherwise.
-
setClientHostName
Sets the client host name to use for the connection.- Parameters:
aClientHostName- Client host name to use
-
getHostName
Gets the host name or IP address to connect to.- Returns:
- host name or IP address to connect to
-
setHostName
Sets the host name or IP address to connect to.- Parameters:
aHostName- Host name or IP address to connect to
-
getPortNumber
public 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
public 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
public boolean isConnected()Is the connection established?- Returns:
trueif connected;falseotherwise.
-
setConnected
protected void setConnected(boolean aIsConnected) Sets whether the connection is established.- Parameters:
aIsConnected-trueif connected;falseotherwise
-
close
Closing the connection.- Specified by:
closein interfaceEPPClientCon- Throws:
EPPConException- Error closing the connection
-
getSSLPropertyListString
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-ArrayofString's.- Returns:
- Space delimited
Stringrepresenting the property list ifaListis notnull;nullotherwise
-