IntelliJ Java IDE
The moose likes Sockets and Internet Protocols and the fly likes Example of SSLSocket Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "Example of SSLSocket" Watch "Example of SSLSocket" New topic
Author

Example of SSLSocket

John Landon
Ranch Hand

Joined: Sep 25, 2008
Posts: 211
Hi,
Where I can find an example of usage of SSLSocket with keystore....
Like here but Socket (because I am on client side).
http://stackoverflow.com/questions/867751/ssl-and-socketchannel

Thanks!
Rob Spoor
Saloon Keeper

Joined: Oct 27, 2005
Posts: 18370

The example with SSLContext and SSLServerSocketFactory can be easily adapted to use a SSLSocketFactory instead of a SSLServerSocketFactory. Using that SSLSocketFactory you can then create (SSL) sockets.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
John Landon
Ranch Hand

Joined: Sep 25, 2008
Posts: 211
Rob Spoor wrote:The example with SSLContext and SSLServerSocketFactory can be easily adapted to use a SSLSocketFactory instead of a SSLServerSocketFactory. Using that SSLSocketFactory you can then create (SSL) sockets.


I figured.. But the problem is that the code does not even compile.
For example: KeyStore keyStore = new KeyStore();
You cannot do because the constructor is protected. You need to do getInstance and I don't know what "type" to provide....

I am looking for some code that has been ran at least.
 
 
subject: Example of SSLSocket
 
Threads others viewed
Is SSLSocket mandatory to use with https?
Accessing a directory on a secure site
SSL via proxy
How to create a SSLSocket on midp ??
Accessing the URL
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture