Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding SSL to TcpListen server?

I have made a simple server using TcpListener and it works great but now I would like the connection to be secure.

The clients that connect would be web servers so does it matter if the certificate is trusted or is that just for web browsers?

I have found muddled answers that are not straight forward!

UPDATED

When I share this application would the user have to make a certificate as well or could all users use the same one? Would using the same one not cause security issues or can you bind the certificate to the application so it cannot be seen?

In other words whats the best practise?

like image 274
arbme Avatar asked Jul 15 '10 19:07

arbme


People also ask

Does TCP IP use SSL?

SSL/TLS protocol makes TCP a secure protocol, and whenever an application needs to send sensitive information over the internet, it is a requirement to use the send over SSL. often times the SSL protocol is used to secure — the application network layer — HTTP protocol.

What is SSL stream?

Provides a stream used for client-server communication that uses the Secure Socket Layer (SSL) security protocol to authenticate the server and optionally the client.


1 Answers

Use SslStream class:

Typically, the SslStream class is used with the TcpClient and TcpListener classes. The GetStream method provides a NetworkStream suitable for use with the SslStream class.

There is a full example on the link.

like image 114
Remus Rusanu Avatar answered Oct 09 '22 09:10

Remus Rusanu