PDA

View Full Version : Random - c# SSL Server


Rookie
04-11-2007, 06:50 AM
Hello everyone, I have a random question. I am trying to create a mini-webserver (very simple) that excepts ssl requests in the .net 2.0 framework. I have been able to create a server that listens on a port (any portI specify) that will return an html page to the requesting browser. I have not been able to implement ssl into this. I know c# has classes that will help me with this but I am stumped.

Has anyone done something similar to this before? I would really appreciate some help or a little guidance. I've looked at MSDN, but all they have for an example using sslStreams for a client/server module that I can't seem to get to work for a webserver.

Thanks,
Rookie.

Rookie
04-12-2007, 12:58 AM
thanks for the reply.

I created the web server (very simplistic server) using a tcplistener and a socket. The listener listens on port 4444 and when a request comes in I takes the byte stream and convert it to a string then analyze the string and return the request page.

I can't figure out how to implement ssl into the model. I should probably use sslStream but I don't know how to use it with sockets.

thanks,
Jon

joelnet
04-12-2007, 10:21 AM
This is complicated to do at a socket level. You will basically have to handle your own certificates and encryption.

You should search around for components that'll help you with it.


Joel Thoms
DiscountASP.NET
http://www.DiscountASP.NET

raymondp
04-12-2007, 11:50 AM
Let me recap to see if I understand you. You have a webserver that will listen for a request. Once you get that request you want to send the requestor an html page through an SSL connection.

Let me know if I got that right?

What webserver are you going to use IIS or Apache?



Raymond


DiscountASP.NET
http://www.DiscountASP.NET

Rookie
04-13-2007, 12:24 AM
So I got frustrated with trying it in .net so I make it in java. Never thought I'd prefer using java to microsoft but it made it a lot easier.

Thanks for the feedback,
Rookie