thanks , unfortunatly i dont have control over the client code and they arent using the .net tcpClient they are using Winsock2 lib
which means i cant use this method, any other ways around this ?
Main Topics
Browse All TopicsI have opened a port on a server which listenens for and processes incoming data using an app in vb which uses TcpListener ( Dim tcpListener As New TcpListener(portNumber))
I have modified the firewall to allow data through on the port and i am getting the data ok. The problem i have is i want to secure the port in some way , in the same way that i can apply an SSL cert to a web site.
Has any one any suggesstions\information on how i would go about this ?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
the actual remote client can modify their code, but i wasnt sure if to use the SSL stream both client and listener would have be using the same
so if i modify my code to use the ssl stream can i just give the actual client a certificate or something that they can add to their side ?
apoligies if i am a bit vague , am new to this side of things
If they can already connect over SSL then you may not need to do anything other than implement it on your side. Otherwise, they will need to create an SSL connection from their side also (can use the same SslStream object).
It would be up to you and/or them to authenticate the connection by checking the certificates that are sent when the connection is made. You don't have to do that and the connection will be encrypted. The example on the Microsoft site shows how to get started doing this.
Anonymous SSL connections don't usually require manually giving anyone a certificate, it's all sent automatically during the SslStream negotiation. It will be encrypted.
However, you will need to generate the certificate and a key-pair to use for your SslStream. This can be done a number of ways. Easiest would be to use a Microsoft CA if you have one on your network. Or you can get a certificate from Versign/Thawte/or whoever. Or you could create a self-signed certificate using something like OpenSSL. When using a self-signed certificate you might have to add it to the certificate stores on the remote side so that it is trusted.
Otherwise, yes, SslStreams act like any other stream you can read and write to so your application should work the same (or with minimal modification).
Business Accounts
Answer for Membership
by: JimUPosted on 2009-11-05 at 07:09:58ID: 25750243
You can create an SslStream. See here: en-us/libr ary/ system .net.secur ity.sslstr eam%28VS.8 0%29.aspx
http://msdn.microsoft.com/
Although the example is in C#, you hopefully can get the idea of how it works. Basically, you still use TcpListener to get the connection, then add an SslStream to the client connection using a cert and key-pair.