File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating SSLSockets

 
Sachin H. Gupta
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Pie
Posts: 1166
17
Java Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic