views:

29

answers:

1

While reading about OpenSSL I've stumbled upon sentence: "It would be nice if security was as simple as linking in a different socket library when building a program".

What is this mentioned socket library? What is it used for (i.e. in Java or C#)?

+4  A: 

A socket is the endpoint of an Internet connection. A socket library is a library that implements sockets so that you can use them in your program for Internet communication.

What the text suggests is that it would be nice if you could replace your regular socket library (which would be for example a DLL on Windows) with a different version, which would automatically add SSL functionality for secure, encrypted connections - but adding SSL functionality is not as simple as that.

In Java or C#, you wouldn't use such a library directly. Java for example has classes in its standard API for working with Internet connections. You'd use that API in your Java program, and the JVM will use the socket library that the operating system provides to do the actual communication.

Jesper
I found at http://cephas.net/blog/2007/10/02/using-a-custom-socket-factory-with-httpclient/ info about how to use somethinig like Custom Socket Factory in HttpClient in Java. Does this Custom Socket Factory relate in some way to Socket Library?
mgamer
No, not really. That is something specific to Apache HttpClient, a way to plug into HttpClient to make it use a socket that you create yourself. The socket library from a Java perspective is much more low level, you (normally) don't deal with that yourself.
Jesper