• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

will java ssl socket connection work with out keystore

 
bhaskar ganapathi
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

i am trying to get a connection on a particualr port through

java SSLSocketFactory . below code works fine but my doubt is how it works

with out keystore!!!. how can i check realy encription happens


int port = 443;//
String host = "localhost";

try {
SSLSocketFactory sslFact =
(SSLSocketFactory)SSLSocketFactory.getDefault();
SSLSocket s =
(SSLSocket)sslFact.createSocket(host, port);

s.setNeedClientAuth(true);
s.startHandshake();
System.out.println("the SSL session was created"+s.getSession() );



 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do not need keystore to establish SSL, since keys are assigned dynamically. However you need it to build a chain of CA, so cacerts used for this purpose. If you get no exceptions you can be sure thatyour connection is secure. You can always verify that by trying to connect to non secure site, or site using not CA signed certificate.
 
bhaskar ganapathi
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic