Step 3: The Client (Get the complete code here)
Entire Source Code of the tutorial here:
https://github.com/illumine/articles/tree/master/Implementing-2-way-SSL-in-Java-using-TLS-and-Self-Signed-Certificates
The client also requires the Keystore/Trustore created in Part-1
Again in the client we have to do a couple of things similar to the server:
The first is to specify the Java Keystore/Trustore we created in Part-1 of this article:
Similarly with the server side described in Part-2, we have to create the client socket as an SSLSocket:
The entire code of the client can be downloaded here.
Next article, Part-4, of this Blog series will assist you to debug the SSL/TLS client/server communication.
Entire Source Code of the tutorial here:
https://github.com/illumine/articles/tree/master/Implementing-2-way-SSL-in-Java-using-TLS-and-Self-Signed-Certificates
The client also requires the Keystore/Trustore created in Part-1
Again in the client we have to do a couple of things similar to the server:
The first is to specify the Java Keystore/Trustore we created in Part-1 of this article:
System.setProperty("javax.net.ssl.keyStore","mysystem.jks"); System.setProperty("javax.net.ssl.keyStorePassword","welcome"); System.setProperty("javax.net.ssl.trustStore","mysystem.jks"); System.setProperty("javax.net.ssl.trustStorePassword","welcome");
Similarly with the server side described in Part-2, we have to create the client socket as an SSLSocket:
SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault(); SSLSocket sslSock = (SSLSocket) factory.createSocket("localhost",8095);
The entire code of the client can be downloaded here.
Next article, Part-4, of this Blog series will assist you to debug the SSL/TLS client/server communication.
No comments:
Post a Comment