Web uygulamalarında gerekli sayfaların ssl ile açılmaya zorlanması (ve diğer sayfaların cleartext olarak açılmaya zorlanması)

by oozturk 30. January 2009 00:33

Bu soruna çözüm üretmek için esasen her ssl gereken sayfanın OnInit event'ine request.IsSecureConnection değerine göre bir Response.Redirect komutu ile yönlendirmek yeter. Ancak her sayfa için bunu yapana kadar hele hele bir de response.redirect diye yapılacak yönlendirme için sürekli if conditionlar ile yorulana kadar daha kolay bir çözüm bulmak daha mantıklı geliyor kulağa.

 

Bunun için internette arama yaparken güzel bir çözüm buldum. Keith Brown tarafından yazılmış olan SslHelper - Get help running a partial SSL website in ASP.NET adlı makalede güzel bir çözüm var. Bu çözümü biraz modifiye ettim ve aşağıdaki gibi bir çözüm daha kolay oldu.

 

Adımlara bakalım 

1.  Aşağıdaki dosyayı uygulamanıza ekleyin.

   PageBases.cs (3,00 kb)

2. SSL istediğiniz sayfalara şu ayarı yapın.

   Kod görünümündeki sayfanın class tanımlama satırındaki Page (System.Web.UI.Page) değeri yerine SecurePage yazın

3. SSL istemediğiniz sayfalara şu ayarı yapın.

   Kod görünümündeki sayfanın class tanımlama satırındaki Page (System.Web.UI.Page) değeri yerine PlainPage yazın 

4. Test edin.

   Visual studio'nun web server'ının SSL desteği yoktur. Bu sebeple eğer bu özelliği kullanıyorsanız sayfa açılmayacaktır! Visual Studio ile SSL sayfalarına sahip bir web uygulamasının debug için ayarlanması (Visual Studio Web Server'ın https yani ssl bağlantılarını kabul etmesinin sağlanması) yazımı okursanız, bu soruna da kolaylıkla çözüm bulabilirsiniz.

 

Tags: , , , , , , ,

ASP.NET

Comments

5/23/2009 7:32:17 AM #

Teşekkürler yalnız build ederken hata veriyor.Bu enhanced page classını nerden import etmemiz gerekiyor.

Mert Turkey

8/5/2010 8:38:14 PM #

You are probably sick of reading it, but you have got a really well written blog. Keep up the the great blog.  

Lanora Mandeville United States

8/6/2010 3:28:35 AM #

I definitely agree with most of the other comments. I really enjoy reading your blog.

Air Jordan Shoes United States

8/11/2010 11:18:27 AM #

Quite Good Blogpost. Would you thoughts if I take a tiny snippets of your article and needless to say link it to your blogposts??

Free Electronic Cigarette Trial United States

8/11/2010 5:06:21 PM #

I have recently started using the blogengine.net and I having some problems here? in your blog you stated that we need to enable write permissions on the App_Data folder...unfortunately I don't understand how to enable it.

elpaso discount broker United States

8/12/2010 6:15:19 PM #

Wonderful learn, I simply passed this onto a colleague who was in search of this info. I've you bookmarked on Digg.

glendale help you sell United States

8/13/2010 12:04:28 AM #

That is some inspirational stuff. Never knew that opinions could be this varied. Thanks for all the enthusiasm to offer such helpful information here.

cambridge mls for sellers United States

8/13/2010 12:23:28 AM #

I was looking for crucial information on this subject. The information was important as I am about to launch my own portal. Thanks for providing a missing link in my business.

cary low cost mls United States

8/18/2010 3:15:35 AM #

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon

oak brook discount broker United States

8/19/2010 2:39:25 AM #

I learn something new on different blogs everyday. It is always refreshing to read posts of other bloggers and learn something from them. Thanks for sharing.

concord discount broker United States

8/19/2010 4:05:21 PM #

I must say that overall I am very taken with this site. It is apparent that you know you subject matter and you are passionate about it. I wish I had got your ability to write. I have bookmarked your site and look forward to more updates.

norwalk for sale by owner United States

8/19/2010 11:43:50 PM #

I like the approach you took with this topic. It's not typical that you just discover something so concise and informative.

concord low cost mls United States

8/21/2010 9:24:57 AM #

thank you for the info.. much appreciated .

girls on cam United States

8/21/2010 9:27:53 AM #

We are a group of volunteers and starting a new initiative in a community. Your blog provided us valuable information to work on.You have done a marvellous job!

Cam Girls United States

8/22/2010 12:15:11 AM #

Tremendous blog. I'll have to remember to check back again.

air jordan 9 United States

8/23/2010 6:49:02 PM #

This is a good,common sense article.Very helpful to one who is just finding the resouces about this part.It will certainly help educate me.

west allis discount broker United States

8/23/2010 11:35:11 PM #

When I originally commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get four emails with the same comment. Is there any way you can remove me from that service? Thanks

cleveland by owner United States

8/29/2010 1:44:46 AM #

Good share, great article, very usefull for us…thanks.

danbury mls United States

8/31/2010 3:42:48 PM #

I hope you never stop!  This is one of the best blogs Ive ever read.  Youve got some mad skill here, man.  I just hope that you dont lose your style because youre definitely one of the coolest bloggers out there.  Please keep it up because the internet needs someone like you spreading the word.

student driver signs United States

9/2/2010 9:07:57 AM #

I just signed up to your RSS feed after reading this post! {Will you be writing|Can you write more dealing with|regarding|about this in future articles?

Carrie Shales United States

9/2/2010 4:44:20 PM #

great blog! keep up the great work!

Abraham Vigneau United States

9/3/2010 6:51:35 AM #

Hi, I read a couple of your great posted posts and wanted to ask if you would be interested in exchanging pages?

Nude Cams United States

9/3/2010 7:08:18 AM #

I would like to thank you for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.

where can i purchase phentermine United States

9/8/2010 6:16:41 PM #

Awesome information, many thanks to the writer. It truly is comprehensible to me now, the effectiveness and value is overwhelming. Thanks once more and good luck!

webblog United States

9/9/2010 1:43:36 AM #

This site needs to be cleaned up a bit. Too many unrelated things being said. Please do something!

Custom Jewelry United States

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Hakkımda...

Aklıma gelen sorunlara çözümler yazmaya çalışıyorum burada. Eğer çözümünü yazmamı istediğiniz sorunlar varsa,  bana e-posta atın :-)

 Iyi kodlamalar..

RecentComments

Comment RSS

Tag cloud