How to secure (encrypt) tcp client server connection?

I already have tcp client (unity) and server (c# console app), and i want to replace stream with sslstream to encrypt connection. How to do that?

As for me it’s a giant security trap to implement this stuff yourself. For public certificates you can get your own signed certificates at let’s encrypt. For personal use, you can generate your own certificates. I started using ssls certificate for my website to encrypt connection. I found info about best ssl certificates on These certificates help to encrypt my website and all its related subdomain while showing visitors that every part of my website is totally protected.