Package org.mozilla.jss.tests
Class JSS_SelfServClient
- java.lang.Object
-
- org.mozilla.jss.tests.JSS_SelfServClient
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classJSS_SelfServClient.HandshakeListenerSSL Handshake Listener implementation.-
Nested classes/interfaces inherited from interface org.mozilla.jss.tests.Constants
Constants.cipher
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Loggerloggerstatic intTEST_CIPHERS-
Fields inherited from interface org.mozilla.jss.tests.Constants
debug_level, jssCipherSuites, sslciphersarray_jdk142, sslciphersarray_jdk150
-
-
Constructor Summary
Constructors Constructor Description JSS_SelfServClient()Default Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearHandshakeCompleted()Clear handshakeCompleted flag to indicate that the system is now ready for another socket connection.voidcloseAllSockets()closes the SSLSocketvoidconfigureCipherSuites(java.lang.String server)voidconfigureDefaultSSLOptions()voidcreateSSLConnections(int numToCreate)Initialize given number of SSLSocket client connection to the SSLServer using the set parameters.intgetSockTotal()returns the total number SSLSockets created.booleangetSuccess()Set status return value to success.booleangetTestCiphers()booleanisHandshakeCompleted()Return true if handshake is completed else return false;booleanisServerAlive()static voidmain(java.lang.String[] args)Main method.voidoutputCipherResults()voidsendServerShutdownMsg()sendServerShutdownMsgvoidsetCertDbPath(java.lang.String aCertDbPath)Initialize the cert db path namevoidsetCipher(int aCipher)Initialize the desired ciphersuite to be set on the socket.voidsetClientCertNick(java.lang.String aClientCertNick)Set client certificatevoidsetFailure()Set status return value to false.voidsetHandshakeCompleted()Set handshakeCompleted flag to indicate that the socket handshake is coplete.voidsetHostName(java.lang.String aHostName)Initialize the hostname to run the servervoidsetPasswordFile(java.lang.String aPasswordFile)Initialize the passwords file namevoidsetPort(int aPort)Initialize the port to run the servervoidsetTestCertCallback(boolean aTestCertCallback)Enable/disable Test Cert Callback.voidsetTestCiphers(boolean t)voidsetVerbose(boolean v)voidtestCiphersuites(int numOfThreads)For every enabled ciphersuite created numOfThreads connections.booleantestJSSCiphersMatchNSS()returns true if JSS is sync with NSS ciphersuites.
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
TEST_CIPHERS
public static final int TEST_CIPHERS
- See Also:
- Constant Field Values
-
-
Method Detail
-
setTestCiphers
public void setTestCiphers(boolean t)
-
getTestCiphers
public boolean getTestCiphers()
-
setVerbose
public void setVerbose(boolean v)
-
testJSSCiphersMatchNSS
public boolean testJSSCiphersMatchNSS()
returns true if JSS is sync with NSS ciphersuites.
-
configureDefaultSSLOptions
public void configureDefaultSSLOptions()
-
configureCipherSuites
public void configureCipherSuites(java.lang.String server)
-
testCiphersuites
public void testCiphersuites(int numOfThreads)
For every enabled ciphersuite created numOfThreads connections.
-
setCipher
public void setCipher(int aCipher)
Initialize the desired ciphersuite to be set on the socket.- Parameters:
aCipher-
-
setHostName
public void setHostName(java.lang.String aHostName)
Initialize the hostname to run the server- Parameters:
aHostName-
-
setPort
public void setPort(int aPort)
Initialize the port to run the server- Parameters:
aPort-
-
setPasswordFile
public void setPasswordFile(java.lang.String aPasswordFile)
Initialize the passwords file name- Parameters:
aPasswordFile-
-
setCertDbPath
public void setCertDbPath(java.lang.String aCertDbPath)
Initialize the cert db path name- Parameters:
aCertDbPath-
-
setTestCertCallback
public void setTestCertCallback(boolean aTestCertCallback)
Enable/disable Test Cert Callback.- Parameters:
aTestCertCallback-
-
setClientCertNick
public void setClientCertNick(java.lang.String aClientCertNick)
Set client certificate- Parameters:
aClientCertNick- Certificate Nick Name
-
isHandshakeCompleted
public boolean isHandshakeCompleted()
Return true if handshake is completed else return false;- Returns:
- handshake status
-
setHandshakeCompleted
public void setHandshakeCompleted()
Set handshakeCompleted flag to indicate that the socket handshake is coplete.
-
clearHandshakeCompleted
public void clearHandshakeCompleted()
Clear handshakeCompleted flag to indicate that the system is now ready for another socket connection.
-
getSockTotal
public int getSockTotal()
returns the total number SSLSockets created.
-
isServerAlive
public boolean isServerAlive()
-
sendServerShutdownMsg
public void sendServerShutdownMsg()
sendServerShutdownMsg
-
closeAllSockets
public void closeAllSockets()
closes the SSLSocket
-
outputCipherResults
public void outputCipherResults()
-
createSSLConnections
public void createSSLConnections(int numToCreate) throws java.lang.ExceptionInitialize given number of SSLSocket client connection to the SSLServer using the set parameters. Each Connection will have a separate thread performing I/O to the Server.- Throws:
java.lang.Exception
-
setFailure
public void setFailure()
Set status return value to false.
-
getSuccess
public boolean getSuccess()
Set status return value to success.
-
main
public static void main(java.lang.String[] args)
Main method. Used for unit testing.
-
-