This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A simple SSL Client Server

 
chander shivdasani
Ranch Hand
Posts: 206
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was reading about SSL and thought of implementing a simple client-server application in which client establishes ssl connection with the server. I tried to google online but couldnt find any examples/resources. Can anyone point me to any resources?
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use SSLSocket and SSLServerSocket, which can be retrieved through SSLSocketFactory and SSLServerSocketFactory. The createSocket and createServerSocket methods return a Socket and ServerSocket respectively, but if you really need any methods from SSLSocket / SSLServerSocket you can just cast the return values.
 
chander shivdasani
Ranch Hand
Posts: 206
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do these classes abstract the entire handshaking mechanism and other steps needed for SSL connection? If yes, then from where do they get certifcates and keys?
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I recall correctly, from the default keystore. You can modify that either using the keytool command or from code (but I can't remember which classes / methods to use).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic