This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes Creating SSLSockets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Creating SSLSockets" Watch "Creating SSLSockets" New topic
Author

Creating SSLSockets

Sachin H. Gupta
Greenhorn

Joined: Oct 10, 2012
Posts: 16
Can I use the following code to create SSLSocket



Or I have to use the SSLSocketFactory ?



Is there any difference in socket if created by different methods. If yes, then which is the preferred way to create a SSLSocket.
Thanks
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 958
    
  10

Sachin TrojanGupta wrote:Can I use the following code to create SSLSocket



No.

Or I have to use the SSLSocketFactory ?

Yes.



Is there any difference in socket if created by different methods. If yes, then which is the preferred way to create a SSLSocket.
Thanks


The question has no meaning since you cannot just caste a Socket to an SSLSocket. An SSLSocket isA Socket (i.e. it extends) but a Socket is not an SSLSocket.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Creating SSLSockets
 
Similar Threads
Plain socket to SSL
Accessing the URL
will java ssl socket connection work with out keystore
meaning of factory
Opened a socket with ssl. isConnected returns true. But when sending data get 403