permaculture playing cards*
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
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: 1037
    
  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
Opened a socket with ssl. isConnected returns true. But when sending data get 403
Accessing the URL
will java ssl socket connection work with out keystore
Plain socket to SSL
meaning of factory