Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am trying to implement the SSL/TLS( Transport Level Security) on my Socket Connections created on System.Net.Socket but I am new for this so I have goggled for this but no feasible solution found so any one can help me how can I secure my socket connection with SSL/TLS.

Thanks in advance
Posted

Thanks Nathan,

But in my case I am not using the WebRequest. I have a client server environment.
On server there is window service running on a port. and client side I am running another window application that creates a socket connection (Socket Programming) by calling Connect() method of class System.Net.Sockets.Sockets. So I want to secure this connection with SSL/TLS. I am using visual studio 2008 with .net 3.5 for crating the client application and window service. You can refer the below code how I am creating a connection between client and server.

clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

               IPAddress remoteIp = IPAddress.Parse("Server IP");
               int serverPort = Convert.ToInt32("Server Port");
                IPEndPoint ipEnd = new IPEndPoint(remoteIp, serverPort);
               clientSocket.Connect(ipEnd);
 
Share this answer
 
This article explains the usage of SSL in the System.Net namespace:
http://msdn.microsoft.com/en-us/library/ds8bxk2a%28v=vs.110%29.aspx[^]

The is also a section (linked on the left) to determine certificate selection.

If you are in a hosted environment, your web Server software can be used to control how SSL operates. If IIS, have a look at the bindings.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900