1

This may sound as basic question for some but I have never done such thing.

Imagine I basically have simple TCP client implemented on C# (e.g. TCPClient class) and simple TCP server implemented using C++ (e.g. using sockets). This connection works well.

Now I want to add SSL on top of this connection. Do I have to implement this in code too? Can't I use some standard tools? Like maybe how web sites are using it?

Can't I do it without writing code?

Both client and server use Windows.

Basically I want my above mentioned TCP connection and read/writes to go through some secure tunnel such as SSL. Or maybe even VPN?

1

Can't I do it without writing code?

Basically I want my above mentioned TCP connection and read/writes to go through some secure tunnel such as SSL. Or maybe even VPN?

You can use stunnel, use a VPN, use a tunnel done with SSH etc. Details depend on your infrastructure, that is which software you can install, which is already available etc. Since you want to have end-to-end encryption you need the necessary software on both sides of the connection.

  • Thanks can that software you linked work autonomously? E.g. if my client restarts – user91560 Nov 13 '15 at 14:28
  • @user200312: It is probably possible to start the tunnel software together with your client but details depend on your actual environment. – Steffen Ullrich Nov 13 '15 at 14:41
  • you mean the stunnel soft? or other like SSH? Yep if computer reboots I need them to start manually... and this way I don't have to change code right? – user91560 Nov 13 '15 at 15:19
  • 1
    @user200312: but the more effort you need to install and configure some external software the more you should think about implementing TLS instead inside your application. There is a reason servers and clients usually have TLS inside instead of requiring outside solutions. – Steffen Ullrich Nov 13 '15 at 16:26
  • 1
    @user200312: your questions move into the directions of setting up specific tools or how to do it in your application etc. I think stackoverflow.com and superuser.com are better for this kind of questions and for any general questions regarding system security I would suggest to ask a new question instead of handling everything inside this question. – Steffen Ullrich Nov 14 '15 at 8:35
1

If your want to make your connection secure, you have 2 options:

  • Configure IPSec policy. With IPSec, two machines create secure tunnel between them and route your traffic with this channel. It is absolutelly transparent for client and server applications.
  • You may create VPN connection (OpenSSL, IPSec/L2TP etc) it is transparent for your client too.

You also may change your code to use SslStream class. No need to implement TLS by hand, but your code still need to be changed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy