Jump to content
  • Advertisement
Sign in to follow this  
deathwearer

C# Server with HTTPS

This topic is 4295 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I' currently searching for tutorial to developpe a C# server communicating with HTTPS. I'v search a lot on the web for such thing, but always found website that explain that with ASP.Net. Sadly I think that ASP.Net doens't give me the flexibility that I need. So if anyone got any nice tutorial (Client/Server side, mostly server) It would be really nice. Thank.

Share this post


Link to post
Share on other sites
Advertisement
Googling for:
SSL C#

Returns a number of relevant results. HTTPS = HTTP over SSL. They don't have to be implemented in the same component.

Share this post


Link to post
Share on other sites
I am not trying to discourage you here but: What are you trying to accomplish? If you do not know what HTTPS/SSL is why are you building this? If you are looking for safe communication without installing IIS (or alike) perhaps Windows Communication Foundation might be an answer. Another option (if HTTP is not required but just safe communication) .NET 2.0 remoting might just be what the doctor ordered...

Share this post


Link to post
Share on other sites
Quote:
Original post by ernow
perhaps Windows Communication Foundation might be an answer. Another option (if HTTP is not required but just safe communication) .NET 2.0 remoting might just be what the doctor ordered...


I'm not going to say that these are bad options for general use, but I hate these kind of suggestions for a beginner who probably doesn't even understand the basics of encryption. All you really need for secure communications are sockets and an encryption routine. An ultra-high-level API is a dangerous crutch if you don't understand what it's doing behind the scenes.

Share this post


Link to post
Share on other sites
I was going to suggest WSE because it's a high level api for security for web services, but also has tons of videos and tutorials on the MSDN explaining what things do behind the scenes and why.

Share this post


Link to post
Share on other sites
Quote:
Original post by ernow
I am not trying to discourage you here but: What are you trying to accomplish? If you do not know what HTTPS/SSL is why are you building this? If you are looking for safe communication without installing IIS (or alike) perhaps Windows Communication Foundation might be an answer. Another option (if HTTP is not required but just safe communication) .NET 2.0 remoting might just be what the doctor ordered...


I have a project to make for a real compagny. The server and the client will be at different place. I have some basic experience with client/server communication but NOTHING about security. If you guys have tutorial along with what you propose, I't would be perfect. thank

Share this post


Link to post
Share on other sites
Quote:
Original post by paulecoyote
Poke around here for WSE http://msdn.microsoft.com/webservices/webservices/building/wse/default.aspx



The problem with WSE is he is going to need to run ASP.NET or another webserver to implement what he wants. It sounds like he wants to implement his server lightweight in code.

Ironically, its not very hard. The gist of it is, first you need to create your TCP server. To do this you will inheirt from System.Net.Sockets.TcpListener(). This will provide you will your TCP server without needed to use ASP or any other 3rd party software.

Once you have your server in place, you are going to want to use System.Net.Security.SslStream for all of your https traffic. This part is a bit more complicated, as you need to setup your certificates, etc...

The following example from Microsoft though should show you everything you need to know. Of course, you will have to make a client after, but that parts alot easier.

Microsoft article with sample source here

EDIT: Oops, no auto linking...

Share this post


Link to post
Share on other sites
Dear Serapth,

I'm really interested about your solution. It doesn't look that hard at first look. I still have some experience in communication between a server and a client over the internet, (C++ and Java) But we didn't see the security part yet in any of my class.

Big thank to everyone. :)

Edit : Just a last question, as I can read, It's not avalable on the framework 1.1? Because I only own MS2003, and no money to buy 2005 :(
(I'll get the Express version if signup still avalable, but I won't be able to sell it heh)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!