aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes will java ssl socket connection work with out keystore Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "will java ssl socket connection work with out keystore" Watch "will java ssl socket connection work with out keystore" New topic
Author

will java ssl socket connection work with out keystore

bhaskar ganapathi
Greenhorn

Joined: Aug 11, 2005
Posts: 15
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() );





Bhaskar G
D Rog
Ranch Hand

Joined: Feb 07, 2004
Posts: 472

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.


Retire your iPod and start with HD Android music player Kamerton | Minimal J2EE container is here | Light weight full J2EE stack | and build tool | Co-author of "Windows programming in Turbo Pascal"
bhaskar ganapathi
Greenhorn

Joined: Aug 11, 2005
Posts: 15
thanks for your reply
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: will java ssl socket connection work with out keystore