SIGN UP MEMBER LOGIN:    
ARTICLE

Creating And Using C# Web Application Over HTTPS - SSL

Posted by Yogesh Kumar Jaiswal Articles | C# Language July 04, 2011
Here you will see how to create and use a C# Web Application over HTTPS - SSL.
Reader Level:


Whenever we use a Web Application, a common concern is security. As Messages are transferred in plain text over the network, anyone can intercept the message and read it. So a solution is to use HTTPS (SSL) instead of HTTP, so that the communication gets encrypted.

Description

You simply need to do the following:

  • Install a Certificate (Issued by Certificate Authority) on the Web Server.
  • Create a Web Application using .Net.
  • Configure the Web Application to use SSL in IIS.

1. Install Certificate

Normally in the Production environment we need to buy the certificate from well know Certification Authority (CA). In the development environment we can make use of .Net SDK's MakeCert.exe which comes with .Net 2.0 SD.
  • Path to the Exe.
    /Program Files/Microsoft Visual Studio 8/SDK/v2.0/bin/MakeCert.exe
     
  • Create and Install the certificate on the Local Machine
    Makecert -sr LocalMachine –ss My –n CN=ServiceModelSamples-HTTPS-Server –sky exchange –sk ServiceModelSamples-HTTPS-Key.


2. Create Web Application using .Net

3. Configure Web Application to use SSL in IIS
  • Type inetmgr in Run dialog box and open IIS.
  • On the Default Website Properties, Select the Directory Security tab:

    SSL1.gif
     
  • Select 'Server Certificate' from 'Secure Communication' section.
  • In the popup Wizard, select 'Assign an Existing Certificate'.
  • Click and Select HTTPS-Server certificate and finish the wizard.
  • Now right-click on your web Application Virtual directory in IIS and select Properties.

    SSL2.jpg
     
  • Select Directory Security tab.
  • Click on Edit button.

    SSL3.jpg
     
  • Check Require Secure Channel (SSL).
  • Press OK and Exit the Properties.

View Result

Test the Web Application for HTTPS.

Now in the browser, browse to your web Application, such as:

https://devpoint.dwny1.ca.kp.org/Point2/App_Web/login.aspx

The Browser will show "The page must be viewed over a secure channel".

SSL4.jpg

Login to add your contents and source code to this article
share this article :
post comment
 

Good Article

Posted by Shalini Juneja Jul 05, 2011
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Become a Sponsor