Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding SSL to .net projects 1

Status
Not open for further replies.

DaveMac1960

IS-IT--Management
Mar 16, 2007
16
US
Everyone,
I have just created a web site and need to use SSL. I'm new to using SSL so I figured I could find something online to help me through the process. NO LUCK.

I have searched high and low for some information on how I add a reference to a SSL Certificate to .net projects so that I can use HTTPS.

Currently, I am waiting on the SSL Certificate process and I would like to go ahead and figure out whatever it is I need to do in my code behind or web.config file or whatever to get ready to use SSL.

Is there somebody out there that can steer me in the right direction? Any help would be appreciated.

Thanks in advance
 
You're not this DaveMac by any chance, are you?



Anyway, setting up an SSL certificate is really not very difficult. There are a few tutorials on how to set the whole thing up out on the web. If you've already ordered your certificate and are waiting for it to come through, then I'll assume that you've already read up on some of it.

The only coding prep that I had to do when I set up SSL on our server was to make sure that the users were using the SSL page instead of w/o the certificate. Since you're using ASP.Net, this property will likely work - it's classic ASP, but I'm just most of that stuff is backwards compatible for ASP.Net:
Code:
Request.ServerVariables("HTTPS")

If the value for that property is set to "on", then the user is using the SSL certificate. You should do a simple check of that property to ensure that they are using the certificate, and if not do a Response.Redirect(" to force them to the page with the certificate.


-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson

[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
 
Nope. Wrong Mac. :)

Thanks for your help. However, I have been trying to find tutorials on how to set this up and I haven't been able to find anything. Could you steer me in that direction?

Thanks for your help,
-Dave
 
Kaht,
Let me further explain. Yes I have looked at some tutorials and have gone through the SSL Certificate setup so my earlier statement is a little off.

My problem is what I need to add to my code behind to make it work with the certificate. So far, it looks like it is no big deal which is almost never the case. Am I wrong here?

Thanks,
Dave
 
So far, it looks like it is no big deal which is almost never the case. Am I wrong here?

Nope, once the certificate is applied all your old code should work right out of the box. As I stated above, the only code change I made to my pages after the certificates were applied was code to force the users to use the certificates (by way of response.redirect) Everything else just works by itself.

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson

[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
 
Wow! That's too easy. Thanks for your help kaht...and peace of mind. :)
 
No problem - and even though you're not the Davey Mac in the link I posted above, you should try out disc golf anyway - it's a hell of a lot of fun [smile]

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson

[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top