<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>varunm</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/varunm/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/varunm/feed.xml</link>
    <description />
    <lastBuildDate>Tue, 16 Apr 2019 06:21:08 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Understanding of MVC Page Life Cycle</title>
      <link>https://docs.microsoft.com/archive/blogs/varunm/understanding-of-mvc-page-life-cycle</link>
      <pubDate>Thu, 03 Oct 2013 04:16:00 GMT</pubDate>
      <dc:creator><![CDATA[mathurvarun]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/varunm/2013/10/03/understanding-of-mvc-page-life-cycle/</guid>
      <description><![CDATA[When you invoke an action in an MVC application, everything happens as if you were simply calling a...]]></description>
      <content:encoded><![CDATA[<p>When you invoke an action in an MVC application, everything happens as if you were simply calling a method in the controller class. How do we go from an http request to a method invocation with arguments? I will try here to describe everything that happens during the MVC request processing. How and why everything is done? A little trip deep into the framework always useful to find some pretty solutions to recurring problems.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/2425.image.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14/2425.image.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/2425.image.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14/2425.image.png" alt="" border="0" /></a></p>
<p>Let&rsquo;s look at each steps in detail. I have put some code as well to understand a little better how everything works in MVC.</p>
<p><strong>Step 1: Routing</strong></p>
<p>In ASP.NET application each asp.net page implements the IHTTPHandler interface.</p>
<p>This interface has a ProcessRequest() method that gets called when you request the page. The ProcessRequest() method is responsible for processing the request and generating the response. So in asp.net application it is simple, you request for a page in the url like <a href="https://mysite1/default.aspx">https://mysite1\default.aspx</a> and then it search for that page on the disk and execute the processrequest method and generate the response.</p>
<p align="left">However in MVC application it doesn&rsquo;t work in that way. There is no physical page exist for a particular request. All the requests are routed to a special class called Controller. The controller is responsible for generating the response and sending the content back to the browser.</p>
<p>When you build a MVC application you can define a bunch of controllers. Each controller can handle multiple requests. For example, all the following will route to same Controller.</p>
<p><a href="https://mysite1/Controller1/1">https://mysite1/Controller1/1</a></p>
<p><a href="https://mysite1/Controller1/2">https://mysite1/Controller1/2</a></p>
<p><a href="https://mysite1/Controller1/3">https://mysite1/Controller1/3</a></p>
<p>These requests will execute the same Controller Controller1 and in that it will extract the id from the URL and process the request. This gives more readable URL then asp.net page.</p>
<p>So how these requests are routed to particular controller. Now the RouteTable come into the picture. Every ASP.NET MVC application has a RouteTable. This routetable is responsible to map the mvc requests to particular controller.</p>
<p>public class MvcApplication : System.Web.HttpApplication</p>
<p>{</p>
<p>public static void RegisterRoutes(RouteCollection routes)</p>
<p>{</p>
<p>routes.IgnoreRoute("{resource}.axd/{*pathInfo}");</p>
<p>routes.MapRoute(</p>
<p>"Default", // Route name</p>
<p>"{controller}/{action}/{id}", // URL with parameters</p>
<p>new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults</p>
<p>);</p>
<p>}</p>
<p>protected void Application_Start()</p>
<p>{</p>
<p>AreaRegistration.RegisterAllAreas();</p>
<p>RegisterRoutes(RouteTable.Routes);</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>Whenever the Application Start the Application_Start events will get called and it will call the method RegisterRoutes which will send the collection of Routes as the parameter and the routes will be added to this Collection which is a Dictionary of NamedMaps.</p>
<p>Each route also references a handler which will handle the rest of the request. When we use MapRoute, what we really do is creating a route by instantiating the 3 dictionaries and defining the default MVC handler: PageRouteHandler. Each RouteHandler implements an interface IRouteHandler.</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top">
<p>public <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.Route">Route</a> <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.RouteCollection/MapPageRoute(String,String,String,Boolean,System.Web.Routing.RouteValueDictionary,System.Web.Routing.RouteValueDictionary,System.Web.Routing.RouteValueDictionary):System.Web.Routing.Route">MapPageRoute</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.String">string</a> routeName, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.String">string</a> routeUrl, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.String">string</a> physicalFile, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Boolean">bool</a> checkPhysicalUrlAccess, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.RouteValueDictionary">RouteValueDictionary</a> defaults,&nbsp;&nbsp; <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.RouteValueDictionary">RouteValueDictionary</a> constraints, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.RouteValueDictionary">RouteValueDictionary</a> dataTokens)</p>
<p>{</p>
<p>if (routeUrl == null)</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.ArgumentNullException/.ctor(String)">ArgumentNullException</a>("routeUrl");</p>
<p>}</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.Route">Route</a> item = new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.Route/.ctor(String,System.Web.Routing.RouteValueDictionary,System.Web.Routing.RouteValueDictionary,System.Web.Routing.RouteValueDictionary,System.Web.Routing.IRouteHandler)">Route</a>(routeUrl, defaults, constraints, dataTokens, new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.PageRouteHandler/.ctor(String,Boolean)">PageRouteHandler</a>(physicalFile, checkPhysicalUrlAccess));</p>
<p>this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.RouteCollection/Add(String,System.Web.Routing.RouteBase)">Add</a>(routeName, item);</p>
<p>return item;</p>
<p>}</p>
<p><strong>Step 2: The URL Routing Module intercepts the request.</strong></p>
<p>Whenever you make a request against an ASP.NET MVC application, the request is intercepted by the UrlRoutingModule HTTP Module.&nbsp;</p>
<p>When the UrlRoutingModule intercepts a request, the first thing the module does is to wrap up the current HttpContext in an HttpContextWrapper object.</p>
<p>The HttpContextWrapper object derives from HTTPContextBase class.</p>
<p>&nbsp;</p>
<p>private <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Void">void</a> <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.UrlRoutingModule/OnApplicationPostResolveRequestCache(Object,System.EventArgs)">OnApplicationPostResolveRequestCache</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Object">object</a> sender, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.EventArgs">EventArgs</a> e)</p>
<p>{</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.HttpApplication">HttpApplication</a> application = (<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.HttpApplication">HttpApplication</a>) sender;</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.HttpContextBase">HttpContextBase</a> context = new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.HttpContextWrapper/.ctor(System.Web.HttpContext)">HttpContextWrapper</a>(application.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.HttpApplication/property:Context:System.Web.HttpContext">Context</a>);</p>
<p>this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.UrlRoutingModule/PostResolveRequestCache(System.Web.HttpContextBase)">PostResolveRequestCache</a>(context);</p>
<p>}</p>
<p>Then the module send this contextBase object to the method called PostResolveRequestCache .</p>
<p>Based on the Context it will return the correct RouteData from the RouteTable which was created in the earlier step based on the URL, form parameters and query string parameters associated with the HTTPContext object.&nbsp;</p>
<p>If the UrlRoutingModule successfully retrieves a RouteData object then the module next creates a RouteContext object that represents the current HttpContext and RouteData.</p>
<p>The module then instantiates a new HttpHandler based on the RouteTable and passes the RouteContext to the new handler&rsquo;s constructor.&nbsp;</p>
<p>In the case of an ASP.NET MVC application,the handler returned from the RouteTable will always be an MvcHandler. This MVCHandler also derive from interface IHTTPHandler and implement the method ProcessRequest().</p>
<p>The last step is it will call the RemapHandler method which will set the MVCHandler just obtained to be the Current HTTP Handler.</p>
<p>&nbsp;</p>
<p>public virtual <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Void">void</a> <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.UrlRoutingModule/PostResolveRequestCache(System.Web.HttpContextBase)">PostResolveRequestCache</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.HttpContextBase">HttpContextBase</a> context)</p>
<p>{</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.RouteData">RouteData</a> routeData = this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.UrlRoutingModule/property:RouteCollection:System.Web.Routing.RouteCollection">RouteCollection</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.RouteCollection/GetRouteData(System.Web.HttpContextBase):System.Web.Routing.RouteData">GetRouteData</a>(context);</p>
<p>if (routeData != null)</p>
<p>{</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.IRouteHandler">IRouteHandler</a> routeHandler = routeData.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.RouteData/property:RouteHandler:System.Web.Routing.IRouteHandler">RouteHandler</a>;</p>
<p>if (routeHandler == null)</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.InvalidOperationException/.ctor(String)">InvalidOperationException</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.String">string</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.String/Format(System.IFormatProvider,String,Object%5b%5d):String">Format</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo">CultureInfo</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo/property:CurrentCulture:System.Globalization.CultureInfo">CurrentCulture</a>, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.SR">SR</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.SR/GetString(String):String">GetString</a>("UrlRoutingModule_NoRouteHandler"), new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Object">object</a>[0]));</p>
<p>}</p>
<p>if (!(routeHandler is <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.StopRoutingHandler">StopRoutingHandler</a>))</p>
<p>{</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.RequestContext">RequestContext</a> requestContext = new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.RequestContext/.ctor(System.Web.HttpContextBase,System.Web.Routing.RouteData)">RequestContext</a>(context, routeData);</p>
<p>context.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.HttpContextBase/property:Request:System.Web.HttpRequestBase">Request</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.HttpRequestBase/property:RequestContext:System.Web.Routing.RequestContext">RequestContext</a> = requestContext;</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.IHttpHandler">IHttpHandler</a> httpHandler = routeHandler.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.IRouteHandler/GetHttpHandler(System.Web.Routing.RequestContext):System.Web.IHttpHandler">GetHttpHandler</a>(requestContext);</p>
<p>if (httpHandler == null)</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.InvalidOperationException/.ctor(String)">InvalidOperationException</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.String">string</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.String/Format(System.IFormatProvider,String,Object%5b%5d):String">Format</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo">CultureInfo</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo/property:CurrentUICulture:System.Globalization.CultureInfo">CurrentUICulture</a>,&nbsp; <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.SR">SR</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.SR/GetString(String):String">GetString</a>("UrlRoutingModule_NoHttpHandler"), new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Object">object</a>[] { routeHandler.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Object/GetType():System.Type">GetType</a>() }));</p>
<p>}</p>
<p>if (httpHandler is <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Routing.UrlAuthFailureHandler">UrlAuthFailureHandler</a>)</p>
<p>{</p>
<p>if (!<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Security.FormsAuthenticationModule">FormsAuthenticationModule</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Security.FormsAuthenticationModule/property:FormsAuthRequired:Boolean">FormsAuthRequired</a>)</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.HttpException/.ctor(Int32,String)">HttpException</a>(0x191, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.SR">SR</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.SR/GetString(String):String">GetString</a>("Assess_Denied_Description3"));</p>
<p>}</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Security.UrlAuthorizationModule">UrlAuthorizationModule</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.Security.UrlAuthorizationModule/ReportUrlAuthorizationFailure(System.Web.HttpContext,Object)">ReportUrlAuthorizationFailure</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.HttpContext">HttpContext</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.HttpContext/property:Current:System.Web.HttpContext">Current</a>, this);</p>
<p>}</p>
<p>else</p>
<p>{</p>
<p>context.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:4.0.0.0:b03f5f7f11d50a3a/System.Web.HttpContextBase/RemapHandler(System.Web.IHttpHandler)">RemapHandler</a>(httpHandler);</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>&nbsp;</p>
<p><strong>Step 4: MVC Handler Executes</strong></p>
<p>MVCHandler also inherit from the IHTTPAsyncHandler. When MVC Handler executes it will call the BeginProcessRequest method of the httpAsyncHandler asynchronously.</p>
<p>When the process request method is called a new controller gets created. The controller is created from a ControllerFactory. There is a ControllerBuilder Class which will set the ControllerFactory.&nbsp;</p>
<p>You can create your own ControllerFactory as well but by default it will be DefaultControllerFactory. The RequestContext and the name of the Contoller will be passed to the method CreateController Method to get the particular Contoller.</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top">
<p>public virtual <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.IController">IController</a> <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.DefaultControllerFactory/CreateController(System.Web.Routing.RequestContext,String):System.Web.Mvc.IController">CreateController</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.RequestContext">RequestContext</a> requestContext, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a> controllerName)</p>
<p>{</p>
<p>if (requestContext == null)</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ArgumentNullException/.ctor(String)">ArgumentNullException</a>("requestContext");</p>
<p>}</p>
<p>if (<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String/IsNullOrEmpty(String):Boolean">IsNullOrEmpty</a>(controllerName))</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ArgumentException/.ctor(String,String)">ArgumentException</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Resources.MvcResources">MvcResources</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Resources.MvcResources/property:Common_NullOrEmpty:String">Common_NullOrEmpty</a>, "controllerName");</p>
<p>}</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Type">Type</a> controllerType = this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.DefaultControllerFactory/GetControllerType(System.Web.Routing.RequestContext,String):System.Type">GetControllerType</a>(requestContext, controllerName);</p>
<p>return this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.DefaultControllerFactory/GetControllerInstance(System.Web.Routing.RequestContext,System.Type):System.Web.Mvc.IController">GetControllerInstance</a>(requestContext, controllerType);</p>
<p>}</p>
<p>&nbsp;</p>
<p>Next, a ControllerContext object is constructed from the RequestContext and the controller by using the method GetContollerInstance.</p>
<p>Finally, the Execute() method is called on the controller class. The ControllerContext is passed to the Execute() method when the Execute() method is called.</p>
<p>&nbsp;</p>
<p><strong>Step 4: The Controller Executes</strong></p>
<p>The Execute() method starts by creating the TempData object. TempData is a dictionary derived from TempDataDictionary class and stored in short lives session and it is a string key and object value.&nbsp;</p>
<p>The Execute() method gets the Action from the RouteData based on the URL.The Controller Class then call the ContollerActionInvoker that builds a list of parameters from the request.</p>
<p>These parameters, extracted from the request parameters, will act as method parameters.The parameters will be passed to whatever controller method gets executed.</p>
<p>Finally It will call the InvokeAction method to execute the Action.</p>
<p>protected override <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void">void</a> <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Controller/ExecuteCore()">ExecuteCore</a>()</p>
<p>{</p>
<p>this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Controller/PossiblyLoadTempData()">PossiblyLoadTempData</a>();</p>
<p>try</p>
<p>{</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a> requiredString = this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Controller/property:RouteData:System.Web.Routing.RouteData">RouteData</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.RouteData/GetRequiredString(String):String">GetRequiredString</a>("action");</p>
<p>if (!this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Controller/property:ActionInvoker:System.Web.Mvc.IActionInvoker">ActionInvoker</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.IActionInvoker/InvokeAction(System.Web.Mvc.ControllerContext,String):Boolean">InvokeAction</a>(base.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerBase/property:ControllerContext:System.Web.Mvc.ControllerContext">ControllerContext</a>, requiredString))</p>
<p>{</p>
<p>this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Controller/HandleUnknownAction(String)">HandleUnknownAction</a>(requiredString);</p>
<p>}</p>
<p>}</p>
<p>finally</p>
<p>{</p>
<p>this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Controller/PossiblySaveTempData()">PossiblySaveTempData</a>();</p>
<p>}</p>
<p>}</p>
<p>public virtual <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Boolean">bool</a> <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerActionInvoker/InvokeAction(System.Web.Mvc.ControllerContext,String):Boolean">InvokeAction</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerContext">ControllerContext</a> controllerContext, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a> actionName)</p>
<p>{</p>
<p>if (controllerContext == null)</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ArgumentNullException/.ctor(String)">ArgumentNullException</a>("controllerContext");</p>
<p>}</p>
<p>if (<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String/IsNullOrEmpty(String):Boolean">IsNullOrEmpty</a>(actionName))</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ArgumentException/.ctor(String,String)">ArgumentException</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Resources.MvcResources">MvcResources</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Resources.MvcResources/property:Common_NullOrEmpty:String">Common_NullOrEmpty</a>, "actionName");</p>
<p>}</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerDescriptor">ControllerDescriptor</a> controllerDescriptor = this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerActionInvoker/GetControllerDescriptor(System.Web.Mvc.ControllerContext):System.Web.Mvc.ControllerDescriptor">GetControllerDescriptor</a>(controllerContext);</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ActionDescriptor">ActionDescriptor</a> actionDescriptor = this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerActionInvoker/FindAction(System.Web.Mvc.ControllerContext,System.Web.Mvc.ControllerDescriptor,String):System.Web.Mvc.ActionDescriptor">FindAction</a>(controllerContext, controllerDescriptor, actionName);</p>
<p>if (actionDescriptor == null)</p>
<p>{</p>
<p>return false;</p>
<p>}</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.FilterInfo">FilterInfo</a> filters = this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerActionInvoker/GetFilters(System.Web.Mvc.ControllerContext,System.Web.Mvc.ActionDescriptor):System.Web.Mvc.FilterInfo">GetFilters</a>(controllerContext, actionDescriptor);</p>
<p>try</p>
<p>{</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.AuthorizationContext">AuthorizationContext</a> context = this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerActionInvoker/InvokeAuthorizationFilters(System.Web.Mvc.ControllerContext,System.Collections.Generic.IList%3cSystem.Web.Mvc.IAuthorizationFilter%3e,System.Web.Mvc.ActionDescriptor):System.Web.Mvc.AuthorizationContext">InvokeAuthorizationFilters</a>(controllerContext,&nbsp; filters.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.FilterInfo/property:AuthorizationFilters:System.Collections.Generic.IList%3cSystem.Web.Mvc.IAuthorizationFilter%3e">AuthorizationFilters</a>, actionDescriptor);</p>
<p>if (context.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.AuthorizationContext/property:Result:System.Web.Mvc.ActionResult">Result</a> != null)</p>
<p>{</p>
<p>this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerActionInvoker/InvokeActionResult(System.Web.Mvc.ControllerContext,System.Web.Mvc.ActionResult)">InvokeActionResult</a>(controllerContext, context.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.AuthorizationContext/property:Result:System.Web.Mvc.ActionResult">Result</a>);</p>
<p>}</p>
<p>else</p>
<p>{</p>
<p>if (controllerContext.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerContext/property:Controller:System.Web.Mvc.ControllerBase">Controller</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerBase/property:ValidateRequest:Boolean">ValidateRequest</a>)</p>
<p>{</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerActionInvoker/ValidateRequest(System.Web.Mvc.ControllerContext)">ValidateRequest</a>(controllerContext);</p>
<p>}</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.IDictionary%3c,%3e">IDictionary</a>&lt;<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a>, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object">object</a>&gt; parameterValues = this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerActionInvoker/GetParameterValues(System.Web.Mvc.ControllerContext,System.Web.Mvc.ActionDescriptor):System.Collections.Generic.IDictionary%3cString,Object%3e">GetParameterValues</a>(controllerContext,actionDescriptor);</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ActionExecutedContext">ActionExecutedContext</a> context2 = this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerActionInvoker/InvokeActionMethodWithFilters(System.Web.Mvc.ControllerContext,System.Collections.Generic.IList%3cSystem.Web.Mvc.IActionFilter%3e,System.Web.Mvc.ActionDescriptor,System.Collections.Generic.IDictionary%3cString,Object%3e):System.Web.Mvc.ActionExecutedContext">InvokeActionMethodWithFilters</a>(controllerContext,filters.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.FilterInfo/property:ActionFilters:System.Collections.Generic.IList%3cSystem.Web.Mvc.IActionFilter%3e">ActionFilters</a>, actionDescriptor, parameterValues);</p>
<p>this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerActionInvoker/InvokeActionResultWithFilters(System.Web.Mvc.ControllerContext,System.Collections.Generic.IList%3cSystem.Web.Mvc.IResultFilter%3e,System.Web.Mvc.ActionResult):System.Web.Mvc.ResultExecutedContext">InvokeActionResultWithFilters</a>(controllerContext, filters.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.FilterInfo/property:ResultFilters:System.Collections.Generic.IList%3cSystem.Web.Mvc.IResultFilter%3e">ResultFilters</a>, context2.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ActionExecutedContext/property:Result:System.Web.Mvc.ActionResult">Result</a>);</p>
<p>}</p>
<p>}</p>
<p>catch (<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Threading.ThreadAbortException">ThreadAbortException</a>)</p>
<p>{</p>
<p>throw;</p>
<p>}</p>
<p>catch (<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Exception">Exception</a> exception)</p>
<p>{</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ExceptionContext">ExceptionContext</a> context3 = this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerActionInvoker/InvokeExceptionFilters(System.Web.Mvc.ControllerContext,System.Collections.Generic.IList%3cSystem.Web.Mvc.IExceptionFilter%3e,System.Exception):System.Web.Mvc.ExceptionContext">InvokeExceptionFilters</a>(controllerContext,filters.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.FilterInfo/property:ExceptionFilters:System.Collections.Generic.IList%3cSystem.Web.Mvc.IExceptionFilter%3e">ExceptionFilters</a>, exception);</p>
<p>if (!context3.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ExceptionContext/property:ExceptionHandled:Boolean">ExceptionHandled</a>)</p>
<p>{</p>
<p>throw;</p>
<p>}</p>
<p>this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerActionInvoker/InvokeActionResult(System.Web.Mvc.ControllerContext,System.Web.Mvc.ActionResult)">InvokeActionResult</a>(controllerContext, context3.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ExceptionContext/property:Result:System.Web.Mvc.ActionResult">Result</a>);</p>
<p>}</p>
<p>return true;</p>
<p>}</p>
<p>&nbsp;</p>
<p><strong>Step 5: The Render View Method is called</strong></p>
<p>The Controller typically either executes either the RedirectToAction Method or the RenderView Method. When you call a controller&rsquo;s RenderView() method,the call is delegated to the current ViewEngine&rsquo;s RenderView() method.</p>
<p>&nbsp;The WebFormViewEngine.RenderView() method uses a class named the ViewLocator class to find the view. Next, it uses a BuildManager to create an instance of a ViewPage class from its path.</p>
<p>Next, if the page has a master page, the location of the master page is set If the page has ViewData, the ViewData is set. Finally, the RenderView() method is called on the ViewPage.</p>
<pre>protected override <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.IView">IView</a> <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormViewEngine/CreateView(System.Web.Mvc.ControllerContext,String,String):System.Web.Mvc.IView">CreateView</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerContext">ControllerContext</a> controllerContext, </pre>
<pre>                            <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a> viewPath, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a> masterPath)</pre>
<pre>{</pre>
<pre>&nbsp;&nbsp;&nbsp; return new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/.ctor(String,String)">WebFormView</a>(viewPath, masterPath);</pre>
<pre>}</pre>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top">
<p>public virtual <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewEngineResult">ViewEngineResult</a> <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewEngineCollection/FindView(System.Web.Mvc.ControllerContext,String,String):System.Web.Mvc.ViewEngineResult">FindView</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ControllerContext">ControllerContext</a> controllerContext, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a> viewName, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a> masterName)</p>
<p>{</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewEngineCollection.%3c%3ec__DisplayClass6">&lt;&gt;c__DisplayClass6</a> class2;</p>
<p>if (controllerContext == null)</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ArgumentNullException/.ctor(String)">ArgumentNullException</a>("controllerContext");</p>
<p>}</p>
<p>if (<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String/IsNullOrEmpty(String):Boolean">IsNullOrEmpty</a>(viewName))</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ArgumentException/.ctor(String,String)">ArgumentException</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Resources.MvcResources">MvcResources</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Resources.MvcResources/property:Common_NullOrEmpty:String">Common_NullOrEmpty</a>, "viewName");</p>
<p>}</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Core:3.5.0.0:b77a5c561934e089/System.Func%3c,%3e">Func</a>&lt;<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.IViewEngine">IViewEngine</a>, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewEngineResult">ViewEngineResult</a>&gt; cacheLocator =&nbsp; new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Core:3.5.0.0:b77a5c561934e089/System.Func%3c,%3e">Func</a>&lt;<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.IViewEngine">IViewEngine</a>, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewEngineResult">ViewEngineResult</a>&gt;(class2, (<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.IntPtr">IntPtr</a>) this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewEngineCollection.%3c%3ec__DisplayClass6/%3cFindView%3eb__4(System.Web.Mvc.IViewEngine):System.Web.Mvc.ViewEngineResult">&lt;FindView&gt;b__4</a>);</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Core:3.5.0.0:b77a5c561934e089/System.Func%3c,%3e">Func</a>&lt;<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.IViewEngine">IViewEngine</a>, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewEngineResult">ViewEngineResult</a>&gt; locator =&nbsp; new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Core:3.5.0.0:b77a5c561934e089/System.Func%3c,%3e">Func</a>&lt;<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.IViewEngine">IViewEngine</a>, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewEngineResult">ViewEngineResult</a>&gt;(class2, (<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.IntPtr">IntPtr</a>) this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewEngineCollection.%3c%3ec__DisplayClass6/%3cFindView%3eb__5(System.Web.Mvc.IViewEngine):System.Web.Mvc.ViewEngineResult">&lt;FindView&gt;b__5</a>);</p>
<p>return this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewEngineCollection/Find(System.Func%3cSystem.Web.Mvc.IViewEngine,System.Web.Mvc.ViewEngineResult%3e,System.Func%3cSystem.Web.Mvc.IViewEngine,System.Web.Mvc.ViewEngineResult%3e):System.Web.Mvc.ViewEngineResult">Find</a>(cacheLocator, locator);</p>
<p>}</p>
<p>public virtual <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void">void</a> <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/Render(System.Web.Mvc.ViewContext,System.IO.TextWriter)">Render</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewContext">ViewContext</a> viewContext, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.IO.TextWriter">TextWriter</a> writer)</p>
<p>{</p>
<p>if (viewContext == null)</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ArgumentNullException/.ctor(String)">ArgumentNullException</a>("viewContext");</p>
<p>}</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object">object</a> obj2 = this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/property:BuildManager:System.Web.Mvc.IBuildManager">BuildManager</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.IBuildManager/CreateInstanceFromVirtualPath(String,System.Type):Object">CreateInstanceFromVirtualPath</a>(this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/property:ViewPath:String">ViewPath</a>, typeof(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object">object</a>));</p>
<p>if (obj2 == null)</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.InvalidOperationException/.ctor(String)">InvalidOperationException</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String/Format(System.IFormatProvider,String,Object%5b%5d):String">Format</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo">CultureInfo</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo/property:CurrentUICulture:System.Globalization.CultureInfo">CurrentUICulture</a>,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Resources.MvcResources">MvcResources</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Resources.MvcResources/property:WebFormViewEngine_ViewCouldNotBeCreated:String">WebFormViewEngine_ViewCouldNotBeCreated</a>,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object">object</a>[] { this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/property:ViewPath:String">ViewPath</a> }));</p>
<p>}</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewPage">ViewPage</a> page = obj2 as <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewPage">ViewPage</a>;</p>
<p>if (page != null)</p>
<p>{</p>
<p>this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/RenderViewPage(System.Web.Mvc.ViewContext,System.Web.Mvc.ViewPage)">RenderViewPage</a>(viewContext, page);</p>
<p>}</p>
<p>else</p>
<p>{</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewUserControl">ViewUserControl</a> control = obj2 as <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewUserControl">ViewUserControl</a>;</p>
<p>if (control == null)</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.InvalidOperationException/.ctor(String)">InvalidOperationException</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String/Format(System.IFormatProvider,String,Object%5b%5d):String">Format</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo">CultureInfo</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo/property:CurrentUICulture:System.Globalization.CultureInfo">CurrentUICulture</a>,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Resources.MvcResources">MvcResources</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Resources.MvcResources/property:WebFormViewEngine_WrongViewBase:String">WebFormViewEngine_WrongViewBase</a>,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object">object</a>[] { this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/property:ViewPath:String">ViewPath</a> }));</p>
<p>}</p>
<p>this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/RenderViewUserControl(System.Web.Mvc.ViewContext,System.Web.Mvc.ViewUserControl)">RenderViewUserControl</a>(viewContext, control);</p>
<p>}</p>
<p>}</p>
<p>&nbsp;</p>
<p>The ViewPage class derives from the base System.Web.UI.Page class. This is the same class that is used for pages in classic ASP.NET.</p>
<p>The final action that RenderView() method performs is to call ProcessRequest() on the page class. Calling ProcessRequest() generates content from the view in the same way that</p>
<p>content is generated from a normal ASP.NET page.</p>
<p>private <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void">void</a> <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/RenderViewPage(System.Web.Mvc.ViewContext,System.Web.Mvc.ViewPage)">RenderViewPage</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewContext">ViewContext</a> context, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewPage">ViewPage</a> page)</p>
<p>{</p>
<p>if (!<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String/IsNullOrEmpty(String):Boolean">IsNullOrEmpty</a>(this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/property:MasterPath:String">MasterPath</a>))</p>
<p>{</p>
<p>page.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewPage/property:MasterLocation:String">MasterLocation</a> = this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/property:MasterPath:String">MasterPath</a>;</p>
<p>}</p>
<p>page.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewPage/property:ViewData:System.Web.Mvc.ViewDataDictionary">ViewData</a> = context.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewContext/property:ViewData:System.Web.Mvc.ViewDataDictionary">ViewData</a>;</p>
<p>page.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewPage/RenderView(System.Web.Mvc.ViewContext)">RenderView</a>(context);</p>
<p>}</p>
<p>public virtual <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void">void</a> <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/Render(System.Web.Mvc.ViewContext,System.IO.TextWriter)">Render</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewContext">ViewContext</a> viewContext, <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.IO.TextWriter">TextWriter</a> writer)</p>
<p>{</p>
<p>if (viewContext == null)</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ArgumentNullException/.ctor(String)">ArgumentNullException</a>("viewContext");</p>
<p>}</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object">object</a> obj2 = this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/property:BuildManager:System.Web.Mvc.IBuildManager">BuildManager</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.IBuildManager/CreateInstanceFromVirtualPath(String,System.Type):Object">CreateInstanceFromVirtualPath</a>(this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/property:ViewPath:String">ViewPath</a>, typeof(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object">object</a>));</p>
<p>if (obj2 == null)</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.InvalidOperationException/.ctor(String)">InvalidOperationException</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String/Format(System.IFormatProvider,String,Object%5b%5d):String">Format</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo">CultureInfo</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo/property:CurrentUICulture:System.Globalization.CultureInfo">CurrentUICulture</a>,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Resources.MvcResources">MvcResources</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Resources.MvcResources/property:WebFormViewEngine_ViewCouldNotBeCreated:String">WebFormViewEngine_ViewCouldNotBeCreated</a>,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object">object</a>[] { this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/property:ViewPath:String">ViewPath</a> }));</p>
<p>}</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewPage">ViewPage</a> page = obj2 as <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewPage">ViewPage</a>;</p>
<p>if (page != null)</p>
<p>{</p>
<p>this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/RenderViewPage(System.Web.Mvc.ViewContext,System.Web.Mvc.ViewPage)">RenderViewPage</a>(viewContext, page);</p>
<p>}</p>
<p>else</p>
<p>{</p>
<p><a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewUserControl">ViewUserControl</a> control = obj2 as <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.ViewUserControl">ViewUserControl</a>;</p>
<p>if (control == null)</p>
<p>{</p>
<p>throw new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.InvalidOperationException/.ctor(String)">InvalidOperationException</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String">string</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String/Format(System.IFormatProvider,String,Object%5b%5d):String">Format</a>(<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo">CultureInfo</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo/property:CurrentUICulture:System.Globalization.CultureInfo">CurrentUICulture</a>,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Resources.MvcResources">MvcResources</a>.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.Resources.MvcResources/property:WebFormViewEngine_WrongViewBase:String">WebFormViewEngine_WrongViewBase</a>,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new <a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object">object</a>[] { this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/property:ViewPath:String">ViewPath</a> }));</p>
<p>}</p>
<p>this.<a href="https://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Mvc:2.0.0.0:31bf3856ad364e35/System.Web.Mvc.WebFormView/RenderViewUserControl(System.Web.Mvc.ViewContext,System.Web.Mvc.ViewUserControl)">RenderViewUserControl</a>(viewContext, control);</p>
<p>}</p>
<p>}</p>
<p>Hope this post helps in understanding the MVC Life Cycle.</p>
</td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top">
<pre>&nbsp;</pre>
</td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top">&nbsp;</td>
</tr>
</tbody>
</table>]]></content:encoded>
    </item>
    <item>
      <title>All about Secure Socket Layer (SSL)</title>
      <link>https://docs.microsoft.com/archive/blogs/varunm/all-about-secure-socket-layer-ssl</link>
      <pubDate>Thu, 26 Sep 2013 04:48:03 GMT</pubDate>
      <dc:creator><![CDATA[mathurvarun]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/varunm/2013/09/26/all-about-secure-socket-layer-ssl/</guid>
      <description><![CDATA[The Secure Socket Layer (SSL) is a commonly used protocol for managing the security of a message...]]></description>
      <content:encoded><![CDATA[<p>The Secure Socket Layer (SSL) is a commonly used protocol for managing the security of a message transmission on the internet. SSL has recently been succeeded by Transport layer Security (TLS), which is based on SSL. SSL uses the program layer located between HTTP and TCP layers. SSL uses the public –and –private key encryption system from RSA Algorithm which also includes the use of digital certificates.</p>  <p><b><font size="2">Why we need SSL</font></b></p>  <p><b>To encrypt Sensitive information</b></p>  <p>Just imagine, you are browsing a website which sends the data in un-encrypted format over the network. You entered your credit card details in the site. One hacker hacked into the network and gets the unencrypted information from the network and gets your credit card details. Result, you will lose money and you won’t even get to know what hit you.</p>  <p>The primary reason why SSL is used is to keep sensitive information sent across the network encrypted so that only the intended recipient can understand it. Since data will be in encrypted format so even if the hacker is able to get the data, he can’t decrypt the information so you are still safe.</p>  <p><b> Authentication</b></p>  <p>In addition to encryption, SSL also provides authentication. Imagine you created a website and your customer are trying to login to your website. In internet, the data is sent through series of computers so any of these computers can pretend to be your website. The malicious servers can trick your users to send the personal information to them.</p>  <p>Using SSL certificate, the Client and the Server can authenticate each other to make sure that they are sending data to the correct client or the server.</p>  <p><u><b>Digital Certificate</b></u></p>  <p>Digital certificates are the vehicle that SSL uses for public-key cryptography. Public-key cryptography uses two different cryptographic keys: a private key and a public key. Public-key cryptography is also known as asymmetric cryptography, because you can encrypt information with one key and decrypt it with the private key from a given public-private key pair.</p>  <p><a name="idx13"></a>Public-private key pairs are simply long strings of data that act as keys to a user's encryption scheme. The user keeps the private key in a secure place (in IIS it would be machine keys folder) and provides the public key to anyone with whom the user wants to communicate. The private key is used to digitally sign all secure communications sent from the user; the public key is used by the recipient to verify the sender's signature.</p>  <p><a name="idx14"></a><a name="idx15"></a><a name="idx16"></a><a name="idx17"></a>The private key is used to decrypt text that has been encrypted with the public key. Client sends a message to the server by encrypting it using the public key. Once the Server receives this message it can decrypt it using the private key. In addition to encrypting messages (which ensures privacy), Server can authenticate itself to the Client (so Client know that it is really the Server who sent the message) by using its private key to encrypt a digital certificate. When Client receives it, Client can use the public key to decrypt it.</p>  <p>A digital certificate serves two purposes: it establishes the owner's identity, and it makes the owner's public key available. A digital certificate is issued by a trusted authority--a certificate authority (CA)--and it is issued only for a limited time. When its expiration date passes, the digital certificate must be replaced.</p>  <p><b><u>Certificate authorities and trust hierarchies</u></b></p>  <p>Trust is a very important concept in digital certificates. Each organization or user must determine which CAs can be accepted as trustworthy.</p>  <p>A user of a security service requiring knowledge of a public key generally needs to obtain and validate a digital certificate containing the required public key. Receiving a digital certificate from a remote party does not give the receiver any assurance about the authenticity of the digital certificate. To verify that the digital certificate is authentic, the receiver needs the public key of the certificate authority that issued the digital certificate.</p>  <p>If the public key user does not already hold an assured copy of the public key of the certificate authority that signed the digital certificate, then the user might need an additional digital certificate to obtain that public key. In general, a chain of multiple digital certificates might be needed, comprising a digital certificate of the public key owner (the end entity) signed by one CA, and optionally one or more additional digital certificates of CAs signed by other CA.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4784.clip_image002_4764A6B8.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4784.clip_5F00_image002_5F00_4764A6B8.jpg"><img title="clip_image002" style="display: inline;" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/0844.clip_image002_thumb_20B61A6B.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/0844.clip_5F00_image002_5F00_thumb_5F00_20B61A6B.jpg" width="541" height="376" /></a></p>  <p>&#160;</p>  <p>&#160;</p>  <p><b><u>SSL Handshake</u></b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/6114.clip_image003_42BE7631.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/6114.clip_5F00_image003_5F00_42BE7631.png"><img title="clip_image003" style="display: inline;" border="0" alt="clip_image003" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4812.clip_image003_thumb_7FFF2AF8.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4812.clip_5F00_image003_5F00_thumb_5F00_7FFF2AF8.png" width="534" height="523" /></a></p>  <ol>   <li>The client sends a client &quot;hello&quot; message that lists the cryptographic capabilities of the client (sorted in client preference order), such as the version of SSL, the cipher suites supported by the client, and the data compression methods supported by the client. The message also contains a 28-byte random number.</li>    <li>The server responds with a server &quot;hello&quot; message that contains the cryptographic method (cipher suite) and the data compression method selected by the server, the session ID, and another random number. <a name="wq22"></a></li> </ol>  <p>Note:</p>  <p>The client and the server must support at least one common cipher suite, or else the handshake fails. The server generally chooses the strongest common cipher suite.</p>  <ol start="start">   <li>The server also sends its digital certificate.</li>    <li>If the server uses SSL V3, and if the application requires a digital certificate for client authentication, the server sends a &quot;digital certificate request&quot; message. In the &quot;digital certificate request&quot; message, the server sends a list of the types of digital certificates supported and the distinguished names of acceptable certificate authorities.</li>    <li>The server sends a server &quot;hello done&quot; message and waits for a client response.</li>    <li>Upon receipt of the server &quot;hello done&quot; message, the client (the Web browser) verifies the validity of the server's digital certificate and checks that the server's &quot;hello&quot; parameters are acceptable. </li>    <li><a name="idx74"></a><a name="idx75"></a>The client sends a &quot;client key exchange&quot; message. This message contains the pre-master secret, a 46-byte random number used in the generation of the symmetric encryption keys and the message authentication code (MAC) keys, encrypted with the public key of the server. </li> </ol>  <p>If the server requested a client digital certificate, the client sends a digital certificate, or if no suitable digital certificate is available, the client sends a &quot;no digital certificate&quot; alert. This alert is only a warning, but the server application can fail the session if client authentication is mandatory.</p>  <p>If the client sent a digital certificate to the server, the client sends a &quot;digital certificate verify&quot; message signed with the client's private key. By verifying the signature of this message, the server can explicitly verify the ownership of the client digital certificate. </p>  <p><a name="wq23"></a>Note:</p>  <p>An additional process to verify the server digital certificate is not necessary. If the server does not have the private key that belongs to the digital certificate, it cannot decrypt the pre-master secret and create the correct keys for the symmetric encryption algorithm, and the handshake fails.</p>  <ol start="start">   <li><a name="idx76"></a>The client uses a series of cryptographic operations to convert the pre-master secret into a master secret, from which all key material required for encryption and message authentication is derived. Then the client sends a &quot;change cipher spec&quot; message to make the server switch to the newly negotiated cipher suite. The next message sent by the client (the &quot;finished&quot; message) is the first message encrypted with this cipher method and keys.</li>    <li>The server responds with a &quot;change cipher spec&quot; and a &quot;finished&quot; message of its own.</li>    <li>The SSL handshake ends, and encrypted application data can be sent.</li> </ol>  <p><b><u>SSL in IIS6</u></b></p>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8203.clip_image004_52316233.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8203.clip_5F00_image004_5F00_52316233.png"><img title="clip_image004" style="display: inline;" border="0" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1541.clip_image004_thumb_41D5EA7A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1541.clip_5F00_image004_5F00_thumb_5F00_41D5EA7A.png" width="582" height="452" /></a></b></p>  <p>1. After the TCP handshake and SSL handshake, The HTTP requests in the encrypted form reach to the HTTP.SYS layer.</p>  <p>2. The Kernel mode HTTP.SYS driver doesn’t know how to decrypt the request.</p>  <p>3. Kernel driver uses the service called HTTP SSL Service to do the operation. This service runs under Lsass.exe and this service runs under the user mode.</p>  <p>4. The HTTP Protocol stack receives the request from the client and then it will place it in the SSL Queue. </p>  <p>5. There is a filter called HTTPFilter in the HTTP SSL Service which keeps listening to the SSL Queue. As soon as the request comes, it will pick it up for processing.<b></b></p>  <p>6. HTTP Filter checks the IP-Address and port from the request. Get the Certificate from the SSL Binding info based on the IP-Address and port, decrypt the request and then send the decrypted request to the HTTP.SYS Layer.</p>  <p>7. After decryption of the request HTTP.SYS knows about the IP-Address, port and the host-header so it will put the request accordingly in the correct worker process request queue. From where w3wp.exe picks it up and work on it.<b></b></p>  <p>8. After processing w3wp.exe sends the response to the HTTP.SYS layer. HTTP.SYS layer again put the response into the SSL Queue.<b></b></p>  <p>9. HTTPFilter again picks up the request from the SSL Queue, get the certificate and then encrypt the request using the private key and then send the encrypted request to the HTTP.SYS.<b></b></p>  <p>10. HTTP.SYS then send this encrypted request to the Client.<b></b></p>  <p><b></b></p>  <p><b><u>SSL in IIS7</u></b></p>  <p>HTTPSSL Service is in UserMode and HTTP.Sys is in Kernel mode. As mentioned above, the IIS6 process of SSL encryption and decryption require lot of context switching between the User mode and the Kernel mode and thus reduce the performance. You can enable the Kernel mode SSL in IIS6 using the registry key as mentioned in the following article</p>  <p><a href="https://technet.microsoft.com/en-in/library/dd441380%28v=office.13%29.aspx">https://technet.microsoft.com/en-in/library/dd441380%28v=office.13%29.aspx</a></p>  <p>In IIS7, The SSL is done by default at the Kernel level at HTTP.SYS layer. So it improves the performance.</p>  <p>In IIS7, instead of using HTTPFilter SSL uses Schannel driver in the Kernel mode itself for the encryption and decryption of the request.</p>  <p><b>IIS6 SSL request/response flow</b></p>  <table cellspacing="0" cellpadding="0" border="0"><tbody>     <tr>       <td width="146">         <p>1. Request            <br />2. HTTP.SYS             <br />3. HTTPFilter             <br />4. HTTP.SYS             <br />5. Worker process             <br />6. HTTP.SYS             <br />7. HTTPFilter             <br />8. HTTP.SYS             <br />9. Response</p>       </td>        <td width="413">         <p>(Encrypted Request from client)           <br />(Kernel Mode driver for HTTP accepts the request)            <br />(Sent to user mode service to decrypt)            <br />(Decrypted request comes back)            <br />(Sent decrypted request to W3Wp =&gt; IIS)            <br />(Response comes back from IIS)            <br />(Sent again to user mode to encrypt response)            <br />(Encrypted response arrives from user mode)            <br />(Encrypted response sent back to client)</p>       </td>     </tr>   </tbody></table>  <p><b>IIS7 SSL request/response flow</b></p>  <table cellspacing="0" cellpadding="0" border="0"><tbody>     <tr>       <td width="148">         <p>1. Request            <br />2. HTTP.SYS             <br />3. Worker process             <br />4. HTTP.SYS             <br />5. Response</p>       </td>        <td width="456">         <p>(Encrypted Request from client)           <br />(Kernel Mode driver for HTTP accepts and decrypts using SChannel)            <br />(Sent decrypted request to W3Wp =&gt; IIS)            <br />(Response from IIS is encrypted using SChannel)            <br />(Encrypted Response sent back to client)</p>       </td>     </tr>   </tbody></table>  <p>This new design of how SSL processing is done inside kernel mode increases performance on IIS7.</p>  <p><b><u>Server Authentication</u></b></p>  <p>SSL by itself does not guarantee that the client is communicating with the correct server.</p>  <p>&#160; To illustrate the risks involved with this protocol, consider the following scenario. There are two servers,<b>Server1</b> (myserver1.com) and <b>Server2</b> (myserver2.com), and one client, <b>Client (</b>IE<b>)</b>. Both servers have valid certificates from a CA that the client trusts. Client wants a secure session with Server1, but Server2 wants to eavesdrop on their communication, and is physically located in such a place that it can do so. The scenario goes as follows:</p>  <p>1. Client sends a request for an SSL session to Server1. The request (and all subsequent traffic) actually goes through Server2. Instead of forwarding Client's request to Server1, Server2 responds directly to the request by sending its own certificate to Client.</p>  <p>2. Client receives Server2's certificate and checks its list of trusted CAs. Since Server2's certificate is signed by the same CA as Server1's certificate, Client accepts the certificate and creates a secure session with Server2.</p>  <p>3. Having completed the secure session with Client, Server2 requests and creates its own SSL session with Server1. From this point, Client sends encrypted information to Server2. Server2 decrypts the information, re-encrypts it, and then sends it to Server1. It does the same for information flowing in the opposite direction. The result is that, although all data is encrypted when it flows over the Internet, Server2 is able to read it, and even change it.</p>  <p>4. <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4621.clip_image005_57DC560C.gif" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4621.clip_5F00_image005_5F00_57DC560C.gif"><img title="clip_image005" style="border: 0px currentcolor; display: inline;" border="0" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1425.clip_image005_thumb_367CB070.gif" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1425.clip_5F00_image005_5F00_thumb_5F00_367CB070.gif" width="403" height="215" /></a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/2047.clip_image006_70F7B044.gif" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/2047.clip_5F00_image006_5F00_70F7B044.gif"><img title="clip_image006" style="border: 0px currentcolor; display: inline;" border="0" alt="clip_image006" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/6675.clip_image006_thumb_4F980AA8.gif" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/6675.clip_5F00_image006_5F00_thumb_5F00_4F980AA8.gif" width="418" height="221" /></a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8206.clip_image007_2E38650C.gif" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8206.clip_5F00_image007_5F00_2E38650C.gif"><img title="clip_image007" style="border: 0px currentcolor; display: inline;" border="0" alt="clip_image007" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/5001.clip_image007_thumb_77E73CFC.gif" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/5001.clip_5F00_image007_5F00_thumb_5F00_77E73CFC.gif" width="427" height="226" /></a></p>  <p>To avoid the above danger, there is something called <b>Server authentication</b>. Server Authentication is a mechanism by which a Client authenticate the server so that Client will get to know if it is talking to the correct server or not. To authenticate the server one condition has to match that the common name in the server's certificate must match its Internet name.</p>  <p>After Enabling Server Authentication the above scenario goes now like this</p>  <p>1. Client sends a request for an SSL session to Server1. The request (and all subsequent traffic) actually goes through Server2. Instead of forwarding Client's request to Server1, Server2 responds directly to Client's request by sending its own certificate to Client.</p>  <p>2. Client receives Server2's certificate and checks its list of trusted CAs. Since Server2's certificate is signed by the same CA as Server1's certificate, Client accepts the certificate and creates a secure session with Server2.</p>  <p>3. After the secure session has been completed, but before any real data has been sent or received, Client compares the Internet name in the certificate it received (myserver2.com) with the name of the server it wants to talk to (myserver1.com). Since they do not match, Client knows that the connection should not continue and disconnects it.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8171.clip_image008_56879760.gif" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8171.clip_5F00_image008_5F00_56879760.gif"><img title="clip_image008" style="border: 0px currentcolor; display: inline;" border="0" alt="clip_image008" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1106.clip_image008_thumb_3527F1C4.gif" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1106.clip_5F00_image008_5F00_thumb_5F00_3527F1C4.gif" width="499" height="268" /></a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/3276.clip_image009_4868A863.gif" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/3276.clip_5F00_image009_5F00_4868A863.gif"><img title="clip_image009" style="border: 0px currentcolor; display: inline;" border="0" alt="clip_image009" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1663.clip_image009_thumb_270902C7.gif" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1663.clip_5F00_image009_5F00_thumb_5F00_270902C7.gif" width="493" height="265" /></a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4743.clip_image010_776AE43A.gif" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4743.clip_5F00_image010_5F00_776AE43A.gif"><img title="clip_image010" style="border: 0px currentcolor; display: inline;" border="0" alt="clip_image010" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/0572.clip_image010_thumb_03F89157.gif" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/0572.clip_5F00_image010_5F00_thumb_5F00_03F89157.gif" width="492" height="264" /></a></p>  <p>To know how client authenticate the server please follow the link</p>  <p><a href="https://support.microsoft.com/kb/257587">https://support.microsoft.com/kb/257587</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Bind multiple sites on same IP address and Port in SSL</title>
      <link>https://docs.microsoft.com/archive/blogs/varunm/bind-multiple-sites-on-same-ip-address-and-port-in-ssl</link>
      <pubDate>Tue, 18 Jun 2013 11:28:34 GMT</pubDate>
      <dc:creator><![CDATA[mathurvarun]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/varunm/2013/06/18/bind-multiple-sites-on-same-ip-address-and-port-in-ssl/</guid>
      <description><![CDATA[&#160;  Until IIS 7.5, the major limitation of IIS is that IIS will allow you to bind only one site...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>Until IIS 7.5, the major limitation of IIS is that IIS will allow you to bind only one site for one IP: Port combination using an SSL certificate.&#160; If you try to bind a second site on the IP address to the same certificate, IIS will give you an error when starting the site up stating that there is a conflict. In order to assign a certificate to be used by multiple IIS sites on the same IP address and port, we need to use a special mechanism. Before we go there let’s understand why it is not possible for IIS to allow the binding of multiple sites on same IP: Port combination using an SSL certificate.</p>  <p><b><u>Classic Chicken and Egg Problem</u></b></p>  <p>We know that IIS identifies a site using three piece of data:</p>  <p>1. IP-Address</p>  <p>2. Port</p>  <p>3. Host Header</p>  <p>You can have multiple HTTP site configured with different combination of above. The binding, for example 192.168.1.0:80 can be configured to site “MyServer1.com”. That means if I browse to IP-address 192.168.1.0 over port 80 then I will hit the site “MyServer1.com”. I can have the binding as 192.168.1.0:80:myserver2.com configured for site “MyServer2.com”. That means when I browse the site over IP-address 192.168.1.0 over port 80 with a host header as “myserver2.com” then I will hit the site MyServer2.com. This allows multiple DNS hostnames on a single server at the same IP address. </p>  <p>However this doesn’t work in HTTPS. To know why it doesn’t work in HTTPS lets understand the SSL handshake briefly.</p>  <p>1. Client - &gt; (SSL Handshake) - &gt; “ Hello, I support XYZ algorithm for encryption” </p>  <p>2. Server -&gt; (SSL Handshake) -&gt; “Hi there, Okay so here is my public certificate. Let’s use algorithm X”</p>  <p>3. Client -&gt; (SSL Handshake)-&gt; “Great we can use that”</p>  <p>4. Client -&gt; (In Encrypted format)-&gt; “HTTP Request”</p>  <p>5. Server -&gt; (In Encrypted format)-&gt; “HTTP Response”</p>  <p>&lt;And now cycle continues&gt;</p>  <p>Now let’s say hypothetically, you have set two sites on same IP-address and port and different host headers and you set two different certificates on both of them.</p>  <p>Look at the steps in SSL Handshake, Client sends the HTTP Request only in Step 4. That means Server doesn’t know what host header HTTP request is referring to until step 4. So at Step 2, Server has only IP-Address and Port information with it, so how can server figure out which certificate it needs to send to the Client as you have bind two certificates to same IP-Address and port.</p>  <p>When a request comes to HTTP.SYS layer, the HTTP.SYS reads the site configuration, including the certificate used to encrypt/decrypt the data. The host name is encrypted in SSL Blob that the client sends. However, IIS needs to know the host name in order to get the right certificate. Without the host name IIS cannot get to the correct site. As IIS is not able to get to the correct site so it cannot get the right certificate to decrypt the SSL blob to get the host name. This is the classic Chicken and Egg problem. We are turning into circles with no way out.</p>  <p>This is the precise reason; HTTP server can only allow one site per IP-Address: Port combination for HTTPS browsing. If you need to bind another site over HTTPS then you need to get either a different IP-Address or bind the site to a different port.</p>  <p>Sometimes getting a new IP-Address or port for each website becomes costly affair. So how we can attach two website to HTTPS over same IP: Port. There are two ways to do it in IIS7.</p>  <p><b><u>Wild Card Certificate.</u></b></p>  <p>A <a href="https://www.sslshopper.com/best-ssl-wildcard-certificate.html">wildcard certificate</a> can secure an unlimited number of first level sub domains on a single domain name. For example, you can get a certificate which is issued to *.mydomain.com. This certificate will secure <a href="https://www.mydomain.com">www.mydomain.com</a>, secure.mydomain.com, welcome.mydomain.com etc. Basically it will work on any subdomain that replaces the wildcard character (*).</p>  <p><b><u>Setting up the Wild Card Certificate</u></b></p>  <p><b></b></p>  <p><b> Step 1: Install the wildcard certificate. </b></p>  <p>Verify if the certificate is properly installed.</p>  <p>1. Select Start –&gt; Run</p>  <p>2. Type in “MMC” and hit enter</p>  <p>3. From the console, select File –&gt; Add / Remove Snap-in</p>  <p>4. Select <i>Certificates</i> from the Add / Remove dialog</p>  <p>5. Select <i>Computer Account</i> when prompt for which certificates the snap-in will manager.</p>  <p>6. Select <i>Local Computer</i> when prompted </p>  <p>7. Click OK to add the Snap-in to the MMC</p>  <p>8. Locate your SSL certificate</p>  <p>9. Right click on the certificate and select properties</p>  <p>10. You should see the * in the friendly name.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/3771.clip_image002_05E1F7B5.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/3771.clip_5F00_image002_5F00_05E1F7B5.jpg"><img title="clip_image002" style="display: inline;" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/7532.clip_image002_thumb_5CF6E2AB.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/7532.clip_5F00_image002_5F00_thumb_5F00_5CF6E2AB.jpg" width="512" height="345" /></a></p>  <p>Once you have installed the certificate then the issued to should be the *.mydomain.com</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/2260.clip_image004_5426DA5F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/2260.clip_5F00_image004_5F00_5426DA5F.png"><img title="clip_image004" style="display: inline;" border="0" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/0804.clip_image004_thumb_19CB647E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/0804.clip_5F00_image004_5F00_thumb_5F00_19CB647E.png" width="353" height="415" /></a></p>  <p><b> Step 2: Setup the wildcard certificate in IIS</b></p>  <p>Let’s say you need following configuration</p>  <p>So let's say you have the following configuration:</p>  <p>Website&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Host Header Value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; IP Address&#160;&#160;&#160;&#160;&#160; Port&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SSL Port    <br />==================================================================     <br />Test1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; www.myserver.com&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 10.0.1.1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 80&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 443     <br />Test2&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; test2.myserver.com&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 10.0.1.1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 80&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 443 </p>  <p>Test3&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; test3.myserver.com&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 10.0.1.1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 80&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 443 </p>  <p><b> IIS6</b></p>  <p>You need to select the certificate for all the three sites which are configured for same IP-Address and port.</p>  <p>To know how to bind the certificates in IIS6 please follow the following link</p>  <p>https://blogs.iis.net/robert_mcmurray/archive/2011/02/17/iis-6-setting-up-ssl-part-3-installing-the-certificate.aspx</p>  <p>After you installed the Certificate on all the websites with same IP address and port and you try to browse the sites. You will see that all of the HTTPS responses come from one specific site.</p>  <p>That means if you try to access <i>https://test1.myserver.com</i>, <i>https://test2.myserver.com</i> or <i>https://test3.myserver.com</i> you will get the response from one site only.</p>  <p>You won't get the corresponding pages from different Websites depending upon the site in URL. Why? Because of the chicken and Egg problem remember. When the request comes to HTTP.SYS layer then Schannel will be able to decrypt the request but after decrypting the request it doesn’t know which site it needs to send the request as all the sites listening to same IP-Address and port.</p>  <p>You will also see that only one of the Websites will be running. Other Websites will be in stopped state because we cannot have multiple Websites running with same IP and same SSL port binding. If you try to start the other Websites you may see something like this below:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/saurabh_singh/WindowsLiveWriter/b6a71e1bdde4_291E/image_4.png" original-url="https://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b6a71e1bdde4_291E/image_4.png"><img title="clip_image005" style="display: inline;" border="0" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4532.clip_image005_10FB5C32.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4532.clip_5F00_image005_5F00_10FB5C32.png" width="475" height="106" /></a></p>  <p><b><u>How to resolve above issue</u></b></p>  <p>To resolve this issue we need to add host headers to the sites.</p>  <p>Go to Start Menu, click Run, type &quot;cmd&quot;, and then click OK.</p>  <p>Type the following command at the command prompt:</p>  <p><b>C:\Inetpub\AdminScripts&gt;cscript.exe adsutil.vbs set /w3svc/&lt;site identifier&gt;/SecureBindings &quot;*:443 :&lt; host header&gt;&quot;</b></p>  <p>For example</p>  <p><b>C:\Inetpub\AdminScripts&gt;cscript.exe adsutil.vbs set /w3svc/1/SecureBindings &quot;10.0.0.1:443:test1.myserver.com&quot;</b></p>  <p> Do this for all the three sites</p>  <p><b>C:\Inetpub\AdminScripts&gt;cscript.exe adsutil.vbs set /w3svc/2/SecureBindings &quot;10.0.0.1:443:test2.myserver.com&quot;</b></p>  <p><b>C:\Inetpub\AdminScripts&gt;cscript.exe adsutil.vbs set /w3svc/3/SecureBindings &quot;10.0.0.1:443:test3.myserver.com&quot;</b></p>  <p><b></b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4571.clip_image007_048D3909.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4571.clip_5F00_image007_5F00_048D3909.jpg"><img title="clip_image007" style="display: inline;" border="0" alt="clip_image007" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8640.clip_image007_thumb_0E05F77F.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8640.clip_5F00_image007_5F00_thumb_5F00_0E05F77F.jpg" width="619" height="319" /></a></p>  <p>You can also change this by changing the metabase.xml for that particular site.</p>  <p>For Example your site id is 1 then you would see following in the Metabase.xml</p>  <p>&lt;IIsWebServer Location =&quot;/LM/W3SVC/1&quot;</p>  <p>AuthFlags=&quot;0&quot;</p>  <p>SSLCertHash=&quot;ee6c56aaacd9e52137ccd4563131c35bdb020712&quot;</p>  <p>SSLStoreName=&quot;MY&quot;</p>  <p><strong>SecureBindings=&quot;:443:&quot;</strong></p>  <p>ServerAutoStart=&quot;TRUE&quot;</p>  <p>ServerBindings=&quot;:80:&quot;</p>  <p>ServerComment=&quot;ssltest&quot;&gt;</p>  <p>Add the hostname in the SecureBindings explicitly for each site.</p>  <p>&lt;IIsWebServer Location =&quot;/LM/W3SVC/1&quot;</p>  <p>AuthFlags=&quot;0&quot;</p>  <p>SSLCertHash=&quot;ee6c56aaacd9e52137ccd4563131c35bdb020712&quot;</p>  <p>SSLStoreName=&quot;MY&quot;</p>  <p><strong>SecureBindings=&quot;:443:www.test.com&quot;</strong></p>  <p>ServerAutoStart=&quot;TRUE&quot;</p>  <p>ServerBindings=&quot;:80:&quot;</p>  <p>ServerComment=&quot;ssltest&quot;&gt;</p>  <p><b> IIS7</b></p>  <p>In IIS7, attaching a wild card certificate is much easier. You can attach the certificate to the website you need to attach to. The moment you select the wildcard certificate the hostname field in the UI will be enabled. You can type the host header in it. You can do the same procedure for multiple sites.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4061.clip_image009_2C703868.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4061.clip_5F00_image009_5F00_2C703868.jpg"><img title="clip_image009" style="display: inline;" border="0" alt="clip_image009" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/5327.clip_image009_thumb_63D64996.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/5327.clip_5F00_image009_5F00_thumb_5F00_63D64996.jpg" width="593" height="298" /></a></p>  <p><b><u>How Wild Card Certificate resolve the Chicken and Egg problem</u></b></p>  <p>We have multiple sites on same IP: Port with the same certificate (wildcard certificate) attached to them. When the request reach to HTTP.SYS layer, the Schannel gets the IP: Port information from the request. Since there is only one certificate attached to that IP: Port Schannel use that wildcard certificate and decrypt the request using the private key. After decrypting the request, HTTP.SYS is able to get the host header information. Using the host header, HTTP.SYS can put the request into the proper request queue.</p>  <p><b><u>Limitation of Wild Card Certificate.</u></b></p>  <p>There are certain limitations of wild card certificate.</p>  <p>1) It can only be applicable to single level of subdomain. For example you got a wild cart certificate for *.mydomain.com then you can bind this certificate to sites such as site1.mydomain.com or site2.mydomain.com. However, you cannot bind the wildcard certificate to Site1.myexample.mydomain.com or Site1.example2.mydomain.com or xyz.abc.mydomain.com etc.</p>  <p>That means the wild cart certificate will work only till first level of subdomain. </p>  <p>2) The wild card certificate will work only if the site has same domain name. That means if you have certificate for *.mydomain.com then you cannot bind this certificate to sites such as <a href="https://www.example.com">www.example.com</a> or <a href="https://www.mydomain2.com">www.mydomain2.com</a> etc. Wild card certificate will work only for sites which have same domain name.</p>  <p>3) You can set the wildcard certificate only for one top level domain. For example you can bind a wild card certificate for <a href="https://www.test1.myserver.com">www.test1.myserver.com</a> or <a href="https://www.test2.myserver.com">www.test2.myserver.com</a>, but you cannot bind the same certificate for hostheader <a href="https://www.test2.myserver.org">www.test2.myserver.org</a> or <a href="https://www.test2.myserver.net">www.test2.myserver.net</a> etc.</p>  <p><b>SAN Certificate (Subject Alternative Name Certificate)</b></p>  <p><b></b></p>  <p><b></b>You can setup the wildcard certificate if the domain name for all the sites are same and first level subdomain changes. What if you want to set up the sites which should work on two different domain names, for example, a site with host header as <a href="https://www.testserver1.com">www.testserver1.com</a> and another site with hostheader as <a href="https://www.testserver2.com">www.testserver2.com</a>. In this case Wildcard certificate won’t help you. To resolve this issue we have SAN Certificate.</p>  <p>A SAN cert allows for <em>multiple domain names</em> to be protected with a single certificate. For example, you could get a certificate for myserver.com, and then add more SAN values to have the same certificate protect myserver.org, myserver.net and even myserver2.com or <a href="https://www.example.com">www.example.com</a>.</p>  <p>You can see the domain names in the Subject Alternative Name option in the Certificate</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4784.clip_image011_1DE51676.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4784.clip_5F00_image011_5F00_1DE51676.jpg"><img title="clip_image011" style="display: inline;" border="0" alt="clip_image011" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8546.clip_image011_thumb_00238BB7.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8546.clip_5F00_image011_5F00_thumb_5F00_00238BB7.jpg" width="346" height="431" /></a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4606.clip_image012_0C4505DE.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4606.clip_5F00_image012_5F00_0C4505DE.png"><img title="clip_image012" style="display: inline;" border="0" alt="clip_image012" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1351.clip_image012_thumb_712C36CF.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1351.clip_5F00_image012_5F00_thumb_5F00_712C36CF.png" width="352" height="437" /></a></p>  <p><b>Setup the SAN certificate in IIS</b></p>  <p>Let’s say you need following configuration</p>  <p>So let's say you have the following configuration:</p>  <p>Website&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Host Header Value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; IP Address&#160;&#160;&#160;&#160;&#160; Port&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SSL Port    <br />==================================================================     <br />Test1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; www.test.edu&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 10.0.1.1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 80&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 443     <br />Test2&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; www.test.com&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 10.0.1.1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 80&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 443</p>  <p> Test3&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <a href="https://www.test.testing.com">www.test.testing.com</a> 10.0.1.1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 80&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 443 </p>  <p><b>IIS 6</b></p>  <p>You need to select the SAN certificate for all the three sites which are configured for same IP-Address and port.</p>  <p><b>Note: </b>The hostheaders which are defined in the Subject Alternative Name, only to those hostheaders you can bind the site. That means if you set the Subject Alternative Name to <a href="https://www.test.edu">www.test.edu</a>, www.test.com, www.test.testing.com then you cannot bind this certificate to a site with hostheader say www.example.com.</p>  <p>To know how to bind the certificates please follow the following link</p>  <p>https://blogs.iis.net/robert_mcmurray/archive/2011/02/17/iis-6-setting-up-ssl-part-3-installing-the-certificate.aspx</p>  <p>After you installed the Certificate on all the websites with same IP address and port and you try to browse the sites. You will see that all of the HTTPS responses come from one specific site.</p>  <p>That means if you try to access <i>https://</i> www.test.edu, <i>https://</i>w<i>ww.test.com or</i> <i>https://</i><a href="https://www.test.testing.com"><i>www.test.testing.com</i></a><i> </i>you will get the response from one site only.</p>  <p>You won't get the corresponding pages from different Websites depending upon the site in URL. Why? Because of the chicken and Egg problem remember. When the request comes to HTTP.SYS layer then Schannel will be able to decrypt the request but after decrypting the request it doesn’t know which site it needs to send the request as all the sites listening to same IP-Address and port.</p>  <p>You will also see that only one of the Websites will be running. Other Websites will be in stopped state because we cannot have multiple Websites running with same IP and same SSL port binding. If you try to start the other Websites you may see something like this below:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/saurabh_singh/WindowsLiveWriter/b6a71e1bdde4_291E/image_4.png" original-url="https://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b6a71e1bdde4_291E/image_4.png"><img title="clip_image005[1]" style="display: inline;" border="0" alt="clip_image005[1]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/3857.clip_image0051_00EBCBD4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/3857.clip_5F00_image0051_5F00_00EBCBD4.png" width="618" height="137" /></a></p>  <p><b><u>How to resolve above issue</u></b></p>  <p>To resolve this issue we need to add host headers to the sites.</p>  <p>Go to Start Menu, click Run, type &quot;cmd&quot;, and then click OK.</p>  <p>Type the following command at the command prompt:</p>  <p><b>C:\Inetpub\AdminScripts&gt;cscript.exe adsutil.vbs set /w3svc/&lt;site identifier&gt;/SecureBindings &quot;*:443 :&lt; host header&gt;&quot;</b></p>  <p>For example</p>  <p><b>C:\Inetpub\AdminScripts&gt;cscript.exe adsutil.vbs set /w3svc/1/SecureBindings &quot;10.0.0.1:443:www.test.edu&quot;</b></p>  <p> Do this for all the three sites</p>  <p><b>C:\Inetpub\AdminScripts&gt;cscript.exe adsutil.vbs set /w3svc/2/SecureBindings &quot;10.0.0.1:443:www.test.com&quot;</b></p>  <p><b>C:\Inetpub\AdminScripts&gt;cscript.exe adsutil.vbs set /w3svc/3/SecureBindings &quot;10.0.0.1:443:www.test.testing.com&quot;</b></p>  <p><b></b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/7026.clip_image013_4D435F75.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/7026.clip_5F00_image013_5F00_4D435F75.jpg"><img title="clip_image013" style="display: inline;" border="0" alt="clip_image013" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/2768.clip_image013_thumb_3DC04DA6.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/2768.clip_5F00_image013_5F00_thumb_5F00_3DC04DA6.jpg" width="685" height="353" /></a></p>  <p>You can also change this by changing the metabase.xml for that particular site</p>  <p>&lt;IIsWebServer Location =&quot;/LM/W3SVC/1&quot;</p>  <p>AuthFlags=&quot;0&quot;</p>  <p>SSLCertHash=&quot;ee6c56aaacd9e52137ccd4563131c35bdb020712&quot;</p>  <p>SSLStoreName=&quot;MY&quot;</p>  <p>SecureBindings=&quot;:443:&quot;</p>  <p>ServerAutoStart=&quot;TRUE&quot;</p>  <p><strong>ServerBindings=&quot;:80:&quot;</strong></p>  <p>ServerComment=&quot;ssltest&quot;&gt;</p>  <p>Add the hostname in the SecureBindings explicitly for each site.</p>  <p>&lt;IIsWebServer Location =&quot;/LM/W3SVC/1&quot;</p>  <p>AuthFlags=&quot;0&quot;</p>  <p>SSLCertHash=&quot;ee6c56aaacd9e52137ccd4563131c35bdb020712&quot;</p>  <p>SSLStoreName=&quot;MY&quot;</p>  <p><strong>SecureBindings=&quot;:443:www.test.com&quot;</strong></p>  <p>ServerAutoStart=&quot;TRUE&quot;</p>  <p>ServerBindings=&quot;:80:&quot;</p>  <p>ServerComment=&quot;ssltest&quot;&gt;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/2134.clip_image015_07C632EA.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/2134.clip_5F00_image015_5F00_07C632EA.jpg"><img title="clip_image015" style="display: inline;" border="0" alt="clip_image015" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/6523.clip_image015_thumb_541DC68B.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/6523.clip_5F00_image015_5F00_thumb_5F00_541DC68B.jpg" width="590" height="371" /></a></p>  <p><b>IIS7</b></p>  <p><b></b>You need to select the certificate for all the three sites which are configured for same IP-Address and port.</p>  <p><b>Note: </b>The hostheaders which are defined in the Subject Alternative Name, only to those hostheaders you can bind the site. That means if you set the Subject Alternative Name to <a href="https://www.test.edu">www.test.edu</a>, www.test.com, www.test.testing.com then you cannot bind this certificate to a site with hostheader say www.example.com.</p>  <p>To know how to bind the certificates in IIS7 please follow the following link</p>  <p><a href="https://www.iis.net/learn/manage/configuring-security/how-to-set-up-ssl-on-iis">https://www.iis.net/learn/manage/configuring-security/how-to-set-up-ssl-on-iis</a></p>  <p>To configure the SAN certificate you need to run the below command after changing the website name, ip-address and port and the host header value.</p>  <p>Go to Start Menu, click Run, type &quot;cmd&quot;, and then click OK.</p>  <p>Go to the location “C:\Windows\System32\inetsrv”</p>  <p>Type the following command at the command prompt:</p>  <p><b>appcmd set site /site.name:”</b>&lt;WEBSiteName&gt;<b>” /+bindings.[protocol='https',bindingInformation='*:443:</b>&lt;hostHeaderValue&gt;<b>']</b></p>  <p><b></b></p>  <p><b></b></p>  <p><b></b>For example</p>  <p><b>appcmd set site /site.name:&quot;</b>Test1<b>&quot; /+bindings.[protocol='https',bindingInformation='*:443:</b>www.test.edu’<b>]</b></p>  <p><b></b></p>  <p><b>appcmd set site /site.name:&quot;</b>Test2<b>&quot; /+bindings.[protocol='https',bindingInformation='*:443:</b>www.test.com’<b>]</b></p>  <p><b></b></p>  <p><b>appcmd set site /site.name:&quot;</b>Test3<b>&quot; /+bindings.[protocol='https',bindingInformation='*:443:</b>www.test.testing.com’<b>]</b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/2133.clip_image017_662F09ED.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/2133.clip_5F00_image017_5F00_662F09ED.jpg"><img title="clip_image017" style="display: inline;" border="0" alt="clip_image017" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4628.clip_image017_thumb_32869D8F.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4628.clip_5F00_image017_5F00_thumb_5F00_32869D8F.jpg" width="600" height="302" /></a></p>  <p>Alternatively you can go to the applicationhost.config and modify the binding part of the website to add the host header. Do this for all the three sites. For example</p>  <p>&lt;site name=&quot;TestSite&quot; id=&quot;2&quot; &gt;</p>  <p>&lt;application path=&quot;/&quot; applicationPool=&quot;TestSite&quot;&gt;</p>  <p>&lt;virtualDirectory path=&quot;/&quot; physicalPath=&quot;C:\Publish&quot; /&gt;</p>  <p>&lt;/application&gt;</p>  <p>&lt;bindings&gt;</p>  <p>&lt;binding protocol=&quot;http&quot; bindingInformation=&quot;*:8089:TestSite&quot; /&gt;</p>  <p><b> &lt;binding protocol=&quot;https&quot; bindingInformation=&quot;*:443:TestSite&quot; /&gt;</b></p>  <p>&lt;/bindings&gt;</p>  <p>&lt;/site&gt;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/7142.clip_image019_10BAC4FE.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/7142.clip_5F00_image019_5F00_10BAC4FE.jpg"><img title="clip_image019" style="display: inline;" border="0" alt="clip_image019" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/0763.clip_image019_thumb_20E68CF7.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/0763.clip_5F00_image019_5F00_thumb_5F00_20E68CF7.jpg" width="658" height="503" /></a></p>  <p><b><u>How SAN Certificate resolve the Chicken and Egg problem</u></b></p>  <p>We have multiple sites on same IP: Port with the same certificate (SAN certificate) attached to them. When the request reach to HTTP.SYS layer, the Schannel gets the IP: Port information from the request. Since there is only one certificate attached to that IP: Port Schannel use that SAN certificate and decrypt the request using the private key. After decrypting the request, HTTP.SYS is able to get the host header information. Using the host header, HTTP.SYS can put the request into the proper request queue.</p>  <p><b><u>Limitation of SAN Certificate.</u></b></p>  <p>There are certain limitations of SAN certificate.</p>  <p>1) One major limitation of SAN certificate is if you have issued the SAN certificate for say two host-headers www.test1.com and <a href="https://www.test2.edu">www.test2.edu</a> but you need to setup a site for <a href="https://www.test3.net">www.test3.net</a> using the same certificate then you can’t use it. You need to get another SAN certificate from the CA with all the three host-headers. In short, for every addition of a host-header you need to get another SAN certificate.</p>  <p>2) There are certain limitations which are defined by the CA on the number of host-header you can add to the Certificate. That means, after a certain number of host-header you cannot add further host-header into it.</p>  <p>&#160;</p>  <p><strong>Server Name Indication in IIS8</strong></p>  <p>&#160;</p>  <p>IIS8 has a new functionality called Server Name Indication (SNI) to overcome this problem. To know more about SNI please follow the following links</p>  <p><a href="https://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-server-name-indication-sni-ssl-scalability">https://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-server-name-indication-sni-ssl-scalability</a></p>  <p><a href="https://blogs.msdn.com/b/kaushal/archive/2012/09/04/server-name-indication-sni-in-iis-8-windows-server-2012.aspx">https://blogs.msdn.com/b/kaushal/archive/2012/09/04/server-name-indication-sni-in-iis-8-windows-server-2012.aspx</a></p>]]></content:encoded>
    </item>
    <item>
      <title>How to create custom Certificate Trust List in Windows Server 2K8 R2</title>
      <link>https://docs.microsoft.com/archive/blogs/varunm/how-to-create-custom-certificate-trust-list-in-windows-server-2k8-r2</link>
      <pubDate>Mon, 10 Jun 2013 22:39:33 GMT</pubDate>
      <dc:creator><![CDATA[mathurvarun]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/varunm/2013/06/10/how-to-create-custom-certificate-trust-list-in-windows-server-2k8-r2/</guid>
      <description><![CDATA[&#160;  In windows server 2003 server we can create our own custom certificate trust list using the...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>In windows server 2003 server we can create our own custom certificate trust list using the UI in IIS to bind the CTL to the SSL certificate.</p>  <p>To check how we can add the custom CTL in IIS6 please follow the following link</p>  <p><a href="https://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/6e8034d4-c5fc-4b98-a9de-44075de5a589.mspx?mfr=true">https://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/6e8034d4-c5fc-4b98-a9de-44075de5a589.mspx?mfr=true</a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/5657.clip_image001_308A5E30.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/5657.clip_5F00_image001_5F00_308A5E30.jpg"><img title="clip_image001" style="display: inline;" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8156.clip_image001_thumb_27BA55E4.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8156.clip_5F00_image001_5F00_thumb_5F00_27BA55E4.jpg" width="535" height="515" /></a></p>  <p>However, the same UI is not provided in IIS7.5. To add the custom CTL in IIS7.5 we need to perform following steps</p>  <p><b><u>Create Custom CTL</u></b></p>  <p>We need to create a custom CTL. We can do it using MakeCTL.exe. However, MakeCTL.exe doesn’t work in Windows Server 2008 R2. So, we need a Windows Server 2003 or Windows Server 2008 (non R2) server to do it.</p>  <p>Step 1: Install MakeCTL.exe.</p>  <p>To install MakeCTL.exe you need to install Windows server 2003 SDK (<a href="https://www.microsoft.com/en-us/download/details.aspx?id=15656">https://www.microsoft.com/en-us/download/details.aspx?id=15656</a>) or .net framework 1.1 SDK.</p>  <p>Step 2: Run MakeCTL.exe as an administrator</p>  <p>Step 3: Click Next on the “Welcome to the Certificate Trust List Wizard”</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/5305.clip_image003_25312426.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/5305.clip_5F00_image003_5F00_25312426.jpg"><img title="clip_image003" style="display: inline;" border="0" alt="clip_image003" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/2605.clip_image003_thumb_03654B95.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/2605.clip_5F00_image003_5F00_thumb_5F00_03654B95.jpg" width="526" height="400" /></a></p>  <p>Step 4: In Certificate Trust List Purpose screen, provide a Prefix for this CTL.&#160; This will work as the friendly name for the CTL. Provide a simpler name for this as whenever you want to attach the CTL to the certificate you need to provide this name. I have given the name as CTLTest.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8015.clip_image005_0F86C5BC.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8015.clip_5F00_image005_5F00_0F86C5BC.jpg"><img title="clip_image005" style="display: inline;" border="0" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1452.clip_image005_thumb_1BA83FE3.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1452.clip_5F00_image005_5F00_thumb_5F00_1BA83FE3.jpg" width="558" height="431" /></a></p>  <p>Step 5: Click on the Add purpose.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/3542.clip_image007_24B4CB64.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/3542.clip_5F00_image007_5F00_24B4CB64.jpg"><img title="clip_image007" style="display: inline;" border="0" alt="clip_image007" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/5670.clip_image007_thumb_77BF6888.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/5670.clip_5F00_image007_5F00_thumb_5F00_77BF6888.jpg" width="560" height="433" /></a></p>  <p>Step 6: In the User Defined Purpose box, add the following in the Object ID field and click OK:&#160;&#160;&#160; <b>1.3.6.1.4.1.311.10.1. </b>Make sure you don’t add any space before or after this value.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/3365.clip_image009_41020D84.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/3365.clip_5F00_image009_5F00_41020D84.jpg"><img title="clip_image009" style="display: inline;" border="0" alt="clip_image009" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4403.clip_image009_thumb_140CAAA9.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4403.clip_5F00_image009_5F00_thumb_5F00_140CAAA9.jpg" width="599" height="461" /></a></p>  <p><b></b>Why we need to provide <b>1.3.6.1.4.1.311.10.1. </b></p>  <p>As per the article <a href="https://support.microsoft.com/kb/287547">https://support.microsoft.com/kb/287547</a> <b>1.3.6.1.4.1.311.10.1 </b>object Id belongs to Certificate Trust List (CTL).</p>  <p>Step 7: Check whether <b>1.3.6.1.4.1.311.10.1 </b>has been added to the list of purposes and has a checkmark on it. If yes, click next.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/6318.clip_image0091_5D4F4FA4.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/6318.clip_5F00_image0091_5F00_5D4F4FA4.jpg"><img title="clip_image009[1]" style="display: inline;" border="0" alt="clip_image009[1]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8446.clip_image0091_thumb_6970C9CB.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8446.clip_5F00_image0091_5F00_thumb_5F00_6970C9CB.jpg" width="581" height="445" /></a></p>  <p>Step 8: Select the “Add from Store” button on the Certificates in the CTL window.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/5756.clip_image011_759243F2.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/5756.clip_5F00_image011_5F00_759243F2.jpg"><img title="clip_image011" style="display: inline;" border="0" alt="clip_image011" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/7652.clip_image011_thumb_3ED4E8EE.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/7652.clip_5F00_image011_5F00_thumb_5F00_3ED4E8EE.jpg" width="574" height="437" /></a></p>  <p>Step 9: In the Select Certificate window, select the certificate of the Trusted Root CAs that you need to configure your CTL for.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/6560.clip_image013_4AF66315.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/6560.clip_5F00_image013_5F00_4AF66315.jpg"><img title="clip_image013" style="display: inline;" border="0" alt="clip_image013" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/6082.clip_image013_thumb_2FDD9407.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/6082.clip_5F00_image013_5F00_thumb_5F00_2FDD9407.jpg" width="559" height="430" /></a></p>  <p>Step 10: In the Certificate Trust List Storage window, select File and click the Browse button.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/5875.clip_image015_66D77240.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/5875.clip_5F00_image015_5F00_66D77240.jpg"><img title="clip_image015" style="display: inline;" border="0" alt="clip_image015" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/6013.clip_image015_thumb_0541B32A.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/6013.clip_5F00_image015_5F00_thumb_5F00_0541B32A.jpg" width="549" height="420" /></a></p>  <p>Step 11: Save the File as .stl format.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/3323.clip_image017_4E845825.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/3323.clip_5F00_image017_5F00_4E845825.jpg"><img title="clip_image017" style="display: inline;" border="0" alt="clip_image017" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/0044.clip_image017_thumb_13507C5A.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/0044.clip_5F00_image017_5F00_thumb_5F00_13507C5A.jpg" width="542" height="412" /></a></p>  <p>Step 12: Click the Next button and see the CTL information in the window to verify</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/2072.clip_image019_1F71F681.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/2072.clip_5F00_image019_5F00_1F71F681.jpg"><img title="clip_image019" style="display: inline;" border="0" alt="clip_image019" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/2330.clip_image019_thumb_16A1EE35.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/2330.clip_5F00_image019_5F00_thumb_5F00_16A1EE35.jpg" width="548" height="383" /></a></p>  <p>Step 13. Click on Finish and it will show a message as “The Certificate Trust List wizard was succeeded”.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8640.clip_image021_22C3685C.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8640.clip_5F00_image021_5F00_22C3685C.jpg"><img title="clip_image021" style="display: inline;" border="0" alt="clip_image021" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/5140.clip_image021_thumb_6C060D57.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/5140.clip_5F00_image021_5F00_thumb_5F00_6C060D57.jpg" width="558" height="341" /></a></p>  <p>Step 14: Copy this STL file manually to the Windows Server 2008 R2 server.</p>  <p><b></b><b><u>Import the CTL in certificate mmc</u></b></p>  <p>Step 1: Click on Intermediate Certification Authorities and Click on Import</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/3683.clip_image023_7827877E.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/3683.clip_5F00_image023_5F00_7827877E.jpg"><img title="clip_image023" style="display: inline;" border="0" alt="clip_image023" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/7444.clip_image023_thumb_416A2C7A.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/7444.clip_5F00_image023_5F00_thumb_5F00_416A2C7A.jpg" width="547" height="391" /></a></p>  <p>Step 2: Click on Next in the Certificate Import Wizard.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1121.clip_image025_7B78F959.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1121.clip_5F00_image025_5F00_7B78F959.jpg"><img title="clip_image025" style="display: inline;" border="0" alt="clip_image025" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/7750.clip_image025_thumb_59AD20C8.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/7750.clip_5F00_image025_5F00_thumb_5F00_59AD20C8.jpg" width="505" height="488" /></a></p>  <p>Step 3: Click on Browse and select the stl file.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/2746.clip_image027_50DD187C.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/2746.clip_5F00_image027_5F00_50DD187C.jpg"><img title="clip_image027" style="display: inline;" border="0" alt="clip_image027" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/6507.clip_image027_thumb_2785D07E.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/6507.clip_5F00_image027_5F00_thumb_5F00_2785D07E.jpg" width="532" height="512" /></a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1777.clip_image029_33A74AA5.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1777.clip_5F00_image029_5F00_33A74AA5.jpg"><img title="clip_image029" style="display: inline;" border="0" alt="clip_image029" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/3683.clip_image029_thumb_55AFA66B.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/3683.clip_5F00_image029_5F00_thumb_5F00_55AFA66B.jpg" width="446" height="343" /></a></p>  <p>Step 4: Keep “Place all certificates in the following store” as “Intermediate Certificate authorities”. Click on Next.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/6355.clip_image031_28BA4390.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/6355.clip_5F00_image031_5F00_28BA4390.jpg"><img title="clip_image031" style="display: inline;" border="0" alt="clip_image031" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/5238.clip_image031_thumb_47248479.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/5238.clip_5F00_image031_5F00_thumb_5F00_47248479.jpg" width="390" height="382" /></a></p>  <p>Step 5: Check the information before the finish. If everything is correct click on finish. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/3122.clip_image033_658EC562.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/3122.clip_5F00_image033_5F00_658EC562.jpg"><img title="clip_image033" style="display: inline;" border="0" alt="clip_image033" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1004.clip_image033_thumb_03F9064C.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1004.clip_5F00_image033_5F00_thumb_5F00_03F9064C.jpg" width="395" height="382" /></a></p>  <p>Step 6: You will get the message as “The import was successful”.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1460.clip_image035_22634735.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1460.clip_5F00_image035_5F00_22634735.jpg"><img title="clip_image035" style="display: inline;" border="0" alt="clip_image035" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4848.clip_image035_thumb_53164EE0.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4848.clip_5F00_image035_5F00_thumb_5F00_53164EE0.jpg" width="427" height="281" /></a></p>  <p><b><u>Add CTL to the certificate</u></b></p>  <p>Step 1: Launch a command prompt in Administrator mode.</p>  <p>Step 2: Type the command as <b>netsh http show sslcert. </b></p>  <p>This will show all the ssl bindings you have on your server. You should recognize which IP and Port combination you need to use. For example I am using IP:Port as 0.0.0.0:443. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1258.clip_image037_71808FC9.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1258.clip_5F00_image037_5F00_71808FC9.jpg"><img title="clip_image037" style="display: inline;" border="0" alt="clip_image037" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/3386.clip_image037_thumb_7DA209F0.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/3386.clip_5F00_image037_5F00_thumb_5F00_7DA209F0.jpg" width="583" height="257" /></a></p>  <p>IP:port : 0.0.0.0:443</p>  <p>Certificate Hash : 6471dc4d170d6aa6fc80511243a30bb3d97d306c</p>  <p>Application ID : {4dc3e181-e14b-4a21-b022-59fc669b0914}</p>  <p>Certificate Store Name: MY</p>  <p>Verify Client Certificate Revocation : Enabled</p>  <p>Verify Revocation Using Cached Client Certificate Only : Disabled</p>  <p>Usage Check : Enabled</p>  <p>Revocation Freshness Time: 0</p>  <p>URL Retrieval Timeout : 0</p>  <p>Ctl Identifier : (null)</p>  <p>Ctl Store Name : (null)</p>  <p>DS Mapper Usage : Disabled</p>  <p>Negotiate Client Certificate : Disabled</p>  <p>Please note down the Certhash value and the appId. We need to use them later.</p>  <p>Note: CTL Identifier and CTL Store Name are both null.&#160;&#160; We need to change it to begin using the CTL. </p>  <p> But to change it we have to delete this binding and add it again with the specified information.</p>  <p>Step 3: Type the command as <b>netsh http delete sslcert ipport=0.0.0.0:443. </b>You will receive the command as “SSL Certificate successfully deleted”</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/6765.clip_image039_09C38418.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/6765.clip_5F00_image039_5F00_09C38418.jpg"><img title="clip_image039" style="margin-right: auto; margin-left: auto; float: none; display: block;" border="0" alt="clip_image039" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4657.clip_image039_thumb_282DC501.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4657.clip_5F00_image039_5F00_thumb_5F00_282DC501.jpg" width="583" height="279" /></a></p>  <p>Step 4: Now add the certificate with the CTL information. Type the command as </p>  <p><b>netsh http add sslcert ipport=0.0.0.0:443 certhash=15e3063e10e3d50127d323d8b6827ddd7ae33936 appid={4dc3e181-e14b-4a21-b022-59fc669b0914} sslctlidentifier=TestCTLs sslctlstorename=CA</b></p>  <p><b></b><b><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4604.clip_image041_469805EA.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4604.clip_5F00_image041_5F00_469805EA.jpg"><img title="clip_image041" style="display: inline;" border="0" alt="clip_image041" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8688.clip_image041_thumb_36A8C126.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8688.clip_5F00_image041_5F00_thumb_5F00_36A8C126.jpg" width="589" height="289" /></a></b></p>  <p>Note: You need to change the Ip:Port ,Certhash,appId and sslCtlidentifier as per your settings. Refer the values you note down in Step 2.&#160; Your sslctlidentifier value is going to be the friendly name of your CTL.&#160; Remember, that the friendly name must be spelled perfectly and with case sensitivity.&#160; Sslctlstorename simply needs to be CA.</p>  <p> If you get the message as </p>  <p><b>“SSL Certificate add failed, Error: 1312 A specified logon session does not exist. It may already have been terminated”</b></p>  <p>First thing you need to check if you are putting the correct name in the sslctlidentifier.</p>  <p>If everything is right then you may need to install following hotfix (If you don’t have Windows Server 2008 R2 SP1).</p>  <p><a href="https://support.microsoft.com/default.aspx?scid=kb;EN-US;981506">https://support.microsoft.com/default.aspx?scid=kb;EN-US;981506</a></p>  <p>After installing the hotfix the certificate will be added. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8231.clip_image043_54A6CF1A.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8231.clip_5F00_image043_5F00_54A6CF1A.jpg"><img title="clip_image043" style="display: inline;" border="0" alt="clip_image043" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/3480.clip_image043_thumb_12BFE9CC.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/3480.clip_5F00_image043_5F00_thumb_5F00_12BFE9CC.jpg" width="587" height="288" /></a></p>  <p>Step 5: You can now check certificate again using the command <b>netsh http show sslcert. </b>It will be shown as below.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/5305.clip_image045_033CD7FD.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/5305.clip_5F00_image045_5F00_033CD7FD.jpg"><img title="clip_image045" style="display: inline;" border="0" alt="clip_image045" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1157.clip_image045_thumb_3D4BA4DC.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1157.clip_5F00_image045_5F00_thumb_5F00_3D4BA4DC.jpg" width="604" height="279" /></a></p>  <p>IP:port : 0.0.0.0:443</p>  <p>Certificate Hash : 6471dc4d170d6aa6fc80511243a30bb3d97d306c</p>  <p>Application ID : {4dc3e181-e14b-4a21-b022-59fc669b0914}</p>  <p>Certificate Store Name : (null)</p>  <p>Verify Client Certificate Revocation : Enabled</p>  <p>Verify Revocation Using Cached Client Certificate Only : Disabled</p>  <p>Usage Check : Enabled</p>  <p>Revocation Freshness Time: 0</p>  <p>URL Retrieval Timeout : 0</p>  <p>Ctl Identifier : CTLTest</p>  <p>Ctl Store Name : CA</p>  <p>DS Mapper Usage : Disabled</p>  <p>Negotiate Client Certificate : Disabled</p>  <p><b>CTL is not honored in initial SSL handshake</b></p>  <p>One would assume that Certificate Trust List (CTL) will limit the list of Trusted Certificate Authorities (CA's) being sent to the client during the initial SSL handshake. However, IIS 6.0/7.0 using CTL's you cannot limit the list of CA's sent back to the client during the SSL/TLS handshake. That means you can't use CTL's to limit the list of certificates that Internet Explorer is showing. IE will show all the certificates irrespective of whether the issuing CA is a part of the CTL or not. For more information follow the following link</p>  <p><a href="https://blogs.msdn.com/b/saurabh_singh/archive/2007/12/07/certificate-trust-list-not-being-honored-by-iis-5-0-6-0-7-0.aspx">https://blogs.msdn.com/b/saurabh_singh/archive/2007/12/07/certificate-trust-list-not-being-honored-by-iis-5-0-6-0-7-0.aspx</a><b></b></p>  <p>Though if you select a certificate whose CA is not a part of the CTL then you will get the error as 403.16: Client Certificate is untrusted or invalid.</p>  <p>Hope this blog helps you.</p>]]></content:encoded>
    </item>
    <item>
      <title>Remove Unwanted HTTP Response Headers</title>
      <link>https://docs.microsoft.com/archive/blogs/varunm/remove-unwanted-http-response-headers</link>
      <pubDate>Tue, 23 Apr 2013 11:53:21 GMT</pubDate>
      <dc:creator><![CDATA[mathurvarun]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/varunm/2013/04/23/remove-unwanted-http-response-headers/</guid>
      <description><![CDATA[The purpose of this blog post is to discuss how to remove unwanted HTTP response headers from the...]]></description>
      <content:encoded><![CDATA[<p><font size="3">The purpose of this blog post is to discuss how to remove unwanted HTTP response headers from the response. Typically we have 3 response headers which many people want to remove for security reason.</font></p> <font size="3"></font>  <ul><font size="3"></font>    <li><font size="3"><b>Server</b> - Specifies web server version.</font></li>   <font size="3"></font>    <li><font size="3"><b>X-Powered-By</b> - Indicates that the website is &quot;powered by ASP.NET.&quot;</font></li>   <font size="3"></font>    <li><font size="3"><b>X-AspNet-Version</b> - Specifies the version of ASP.NET used.</font></li>   <font size="3"></font></ul> <font size="3"></font>  <p><font size="3">Before you go any further, you should evaluate whether or not you need to remove these headers. If you have decided to remove these headers because of a security scan on your site, you may want to read the following blog post by David Wang. </font></p> <font size="3"></font>  <p><a href="https://blogs.msdn.com/b/david.wang/archive/2006/03/29/silly-security-scans.aspx"><font size="3">https://blogs.msdn.com/b/david.wang/archive/2006/03/29/silly-security-scans.aspx</font></a></p> <font size="3"></font>  <p><font size="3">If you would like to go ahead and remove the headers then follow the following options.</font></p> <font size="3"></font>  <p><font size="3"><b><u>Server</u></b><u> <b>Header</b></u></font></p> <font size="3"></font>  <p><b></b><font size="3">There are three ways to remove the Server header from the response. The best one is to use the third option.</font></p> <font size="3"></font>  <p><font size="3">1. <b>Using the Registry key</b>.</font></p> <font size="3"></font>  <p><font size="3">Create a DWORD entry called <strong>DisableServerHeader</strong> in the following Registry key and set the value to <b>1</b>.</font></p> <font size="3"></font>  <p><font size="3">HKLM\SYSTEM\CurrentControlSet\Services\HTTP\Parameters</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8877.image_5994F91B.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8877.image_5F00_5994F91B.png"><font size="3"><img title="image" style="border: 0px currentcolor; display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/2021.image_thumb_17AE13CD.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/2021.image_5F00_thumb_5F00_17AE13CD.png" width="588" height="389" /></font></a><font size="3"> </font></p> <font size="3"></font>  <p><font size="3">After adding the Registry key, restart the HTTP service using the <i>net stop http</i> command and the <i>net start http</i> command. If the HTTP service doesn’t start up then use the <i>iisreset</i> command. If that also doesn’t work then you can restart the server.</font></p> <font size="3"></font>  <p><font size="3">Please note that this method is used only when the Server header comes as “<b>Microsoft-HTTPAPI/2.0</b>”.</font></p> <font size="3"></font>  <p><font size="3">When the request comes to IIS, it is first goes to http.sys driver. HTTP.SYS driver either handle the request on its own or send it to User mode for further processing. When the request goes to User mode that’s the time it returns the server header as “<b>Microsoft-IIS/7.5.”. </b></font></p> <font size="3"></font>  <p><font size="3">However when the request returns from the HTTP.SYS driver then the server header comes as “<b>Microsoft-HTTPAPI/2.0</b>”. By placing the above registry key it will remove this specific header</font></p> <font size="3"></font>  <p><font size="3">If you would like to remove the Server header as “<b>Microsoft-IIS/7.5.”, </b>then follow the following methods.</font></p> <font size="3"></font>  <p><font size="3"><b>2. </b><b>Using the URLScan tool.</b></font></p> <font size="3"></font>  <p><font size="3">Install the URLScan in your machine. Please follow the following link for that</font></p> <font size="3"></font>  <p><a href="https://www.iis.net/downloads/microsoft/urlscan"><font size="3">https://www.iis.net/downloads/microsoft/urlscan</font></a></p> <font size="3"></font>  <p><font size="3">After installing URLScan, open the URLScan.ini file typically located in the %WINDIR%\System32\Inetsrv\URLscan folder. After opening it, search for the key <b>RemoveServerHeader . </b>By default it is set to 0, but to remove the Server header, change the value to <b>1</b>.Doing so will remove the Server header <b>Server: Microsoft-IIS/7.5 </b>from the User mode response.</font></p> <font size="3"></font>  <p>&#160;</p> <font size="3"></font>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/6403.image_7C9544BE.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/6403.image_5F00_7C9544BE.png"><font size="3"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/0535.image_thumb_651A908D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/0535.image_5F00_thumb_5F00_651A908D.png" width="526" height="358" /></font></a><font size="3"> </font></p> <font size="3"></font>  <p><b></b></p> <font size="3"></font>  <p><font size="3">Please note that changes made by URLScan at global level apply to all of your sites. If you would like to setup this for particular site then look at the following article (site filter section)</font></p> <font size="3"></font>  <p><a href="https://www.iis.net/learn/extensions/working-with-urlscan/urlscan-setup"><font size="3">https://www.iis.net/learn/extensions/working-with-urlscan/urlscan-setup</font></a></p> <font size="3"></font>  <p><font size="3">There are also some pitfalls to using URLScan. You can learn about those pitfalls at the following URL:</font></p> <font size="3"></font>  <p><font size="3">https://msdn.microsoft.com/en-us/library/ff648552.aspx#ht_urlscan_008 </font></p> <font size="3"></font>  <p><font size="3"><b>3. </b><b>Using URLRewrite</b></font></p> <font size="3"></font>  <p><font size="3">If you don’t want to go with URLScan, you can use the URLRewrite module to remove the value of the Server header. Please note that it will not remove the header all together but it will remove the value of it.</font></p> <font size="3"></font>  <p><font size="3">Step 1. Install URLRewrite. To install the URLRewrite please go to the following link</font></p> <font size="3"></font>  <p><a href="https://www.iis.net/downloads/microsoft/url-rewrite"><font size="3">https://www.iis.net/downloads/microsoft/url-rewrite</font></a></p> <font size="3"></font>  <p><font size="3">Step 2. Open the site on which you would like to remove the Server header and click on the URLRewrite section<b>.</b></font></p> <font size="3"></font>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/2185.image_69446852.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/2185.image_5F00_69446852.png"><font size="3"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/7801.image_thumb_3BE2D282.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/7801.image_5F00_thumb_5F00_3BE2D282.png" width="495" height="401" /></font></a><font size="3"> </font></p> <font size="3"></font>  <p><b></b><font size="3">Step 4. Click on the “<b>View Server Variables” </b>in the Actions pane in the right hand side.</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/7220.image_52557109.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/7220.image_5F00_52557109.png"><font size="3"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8054.image_thumb_50387240.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8054.image_5F00_thumb_5F00_50387240.png" width="525" height="289" /></font></a><font size="3"> </font></p> <font size="3"></font>  <p><b></b><font size="3">Step 5. Click on the Add button and then enter “<b>RESPONSE_SERVER” </b>in the textbox provided.</font></p> <font size="3"></font>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/6562.image_21870933.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/6562.image_5F00_21870933.png"><font size="3"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/5582.image_thumb_1FD63D5F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/5582.image_5F00_thumb_5F00_1FD63D5F.png" width="535" height="232" /></font></a><font size="3"> </font></p> <font size="3"></font>  <p><font size="3">Step 6. Now we need to create an outbound rule. To know how to create an outbound rule, look at the following link</font></p> <font size="3"></font>  <p><a href="https://www.iis.net/learn/extensions/url-rewrite-module/creating-outbound-rules-for-url-rewrite-module"><font size="3">https://www.iis.net/learn/extensions/url-rewrite-module/creating-outbound-rules-for-url-rewrite-module</font></a></p> <font size="3"></font>  <p><b></b><font size="3">Step 7. Create an Outbound rule as the following.</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/5756.image_036485DD.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/5756.image_5F00_036485DD.png"><font size="3"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8715.image_thumb_4FBC197E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8715.image_5F00_thumb_5F00_4FBC197E.png" width="544" height="587" /></font></a><font size="3"> </font></p> <font size="3"></font>  <p><font size="3">Please note that this is a website-specific rule. If you want to create the rule for all of your applications, create the rule at the server level. Also, some applications, especially third party applications, may require the Server header, so you may need to remove this rule for those applications.</font></p> <font size="3"></font>  <p><b><u><font size="3">X-Powered-By</font></u></b></p> <font size="3"></font>  <p><b></b><font size="3"> There are two ways to do remove this header as well. Second method would be the preferred one.</font></p> <font size="3"></font>  <p><font size="3">1. <b>Using IIS HTTP Response headers.</b></font></p> <font size="3"></font>  <p><font size="3">Open the site which you would like to open and then click on the HTTP Response Headers option.</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/7824.image_5FE7E177.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/7824.image_5F00_5FE7E177.png"><font size="3"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/5287.image_thumb_0B4C0272.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/5287.image_5F00_thumb_5F00_0B4C0272.png" width="521" height="357" /></font></a><font size="3">&#160; </font></p> <font size="3"></font>  <p><font size="3">Click on the <b>X-Powered-By</b> header and then click Remove on the Actions Pane to remove it from the response.</font></p>  <p><font size="3"></font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8311.image_73D14E40.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8311.image_5F00_73D14E40.png"><font size="3"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8321.image_thumb_123B8F2A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8321.image_5F00_thumb_5F00_123B8F2A.png" width="544" height="166" /></font></a><font size="3"> </font></p> <font size="3"></font>  <p><font size="3">2. <b>Using URLRewite Rule.</b></font></p>  <p><font size="3">Please note that it will not remove the header all together but it will remove the value of it.</font></p> <font size="3"></font>  <p><font size="3">Step 1. Install URLRewrite. To install the URLRewrite please go to the following link</font></p> <font size="3"></font>  <p><a href="https://www.iis.net/downloads/microsoft/url-rewrite"><font size="3">https://www.iis.net/downloads/microsoft/url-rewrite</font></a></p> <font size="3"></font>  <p><font size="3">Step 2. Open the site on which you would like to remove the X-Powered-By header and Click on the URLRewrite section<b>.</b></font></p> <font size="3"></font>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8233.image_65462C4E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8233.image_5F00_65462C4E.png"><font size="3"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/7245.image_thumb_0E019198.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/7245.image_5F00_thumb_5F00_0E019198.png" width="560" height="509" /></font></a><font size="3"> </font></p> <font size="3"></font>  <p><b></b><font size="3">Step 3. Click on the “<b>View Server Variables” </b>in the Actions pane in the right hand side.</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/5287.image_2B2739A2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/5287.image_5F00_2B2739A2.png"><font size="3"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4617.image_thumb_1DE0B08F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4617.image_5F00_thumb_5F00_1DE0B08F.png" width="573" height="315" /></font></a><font size="3"> </font></p> <font size="3"></font>  <p><b></b><font size="3">Step 4. Click on the Add button and then enter <b>“RESPONSE_X-POWERED-BY” </b>in the textbox provided.</font></p> <font size="3"></font>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/2451.image_44F387CB.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/2451.image_5F00_44F387CB.png"><font size="3"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/8625.image_thumb_635DC8B4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/8625.image_5F00_thumb_5F00_635DC8B4.png" width="588" height="255" /></font></a><font size="3"> </font></p> <font size="3"></font>  <p><b></b><font size="3">Step 5. Now we need to create an outbound rule. To know how to create an outbound rule, look at the following link</font></p> <font size="3"></font>  <p><a href="https://www.iis.net/learn/extensions/url-rewrite-module/creating-outbound-rules-for-url-rewrite-module"><font size="3">https://www.iis.net/learn/extensions/url-rewrite-module/creating-outbound-rules-for-url-rewrite-module</font></a></p> <font size="3"></font>  <p><b></b><font size="3">Step 6. Create an Outbound rule as the following</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/2620.image_16B2203A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/2620.image_5F00_16B2203A.png"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1731.image_thumb_15015466.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1731.image_5F00_thumb_5F00_15015466.png" width="628" height="633" /></a> </p> <font size="3"></font>  <p><font size="3">Please note that this is a website-specific rule. If you want to create the rule for all of your applications, create the rule at the server level. Also, some applications, especially third party applications, may require the x-powered-by header, so you may need to remove this rule for those applications.</font></p> <font size="3"></font>  <p><b><u><font size="3">X-AspNet-Version</font></u></b></p> <font size="3"></font>  <p><font size="3">There are two ways to do remove this header as well. Preferred one is the first one.</font></p> <font size="3"></font>  <p><font size="3"><b>1. </b><b>Using the httpRuntime element.</b></font></p> <font size="3"></font>  <p><font size="3">Add the following line in your web.config in the &lt;system. Web&gt; section</font></p> <font size="3"></font>  <p><b></b></p> <font size="3"></font>  <p><b><font size="3"> &lt;httpRuntime enableVersionHeader=&quot;false&quot; /&gt;</font></b></p> <font size="3"></font>  <p><b></b></p> <font size="3"></font>  <p><font size="3">2. <b>Using an URLRewite rule</b>.</font></p>  <p><font size="3">Please note that it will not remove the header all together but it will remove the value of it.</font></p> <font size="3"></font>  <p><font size="3">Step 1. Install URLRewrite. To install the URLRewrite please go to the following link</font></p> <font size="3"></font>  <p><a href="https://www.iis.net/downloads/microsoft/url-rewrite"><font size="3">https://www.iis.net/downloads/microsoft/url-rewrite</font></a></p> <font size="3"></font>  <p><font size="3">Step 2. Open the site on which you would like to remove the Server header and go to the URLRewrite section<b>.</b></font></p> <font size="3"></font>  <p><font size="3"></font></p> <font size="3"></font>  <p><b></b></p> <font size="3"></font>  <p><b><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/7762.image_53F20311.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/7762.image_5F00_53F20311.png"><font size="3"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1004.image_thumb_119EEACE.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1004.image_5F00_thumb_5F00_119EEACE.png" width="524" height="476" /></font></a></b></p> <font size="3"></font>  <p><b></b><font size="3">Step 3. Click on the “<b>View Server Variables” </b>in the Actions pane in the right hand side.</font></p>  <p><font size="3"></font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1423.image_67DB6FDA.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1423.image_5F00_67DB6FDA.png"><font size="3"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/7776.image_thumb_4CC2A0CC.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/7776.image_5F00_thumb_5F00_4CC2A0CC.png" width="608" height="334" /></font></a><font size="3"> </font></p> <font size="3"></font>  <p><b></b><font size="3">Step 4. Click on the Add button and then enter <b>“RESPONSE_X-ASPNET-VERSION” </b>in the textbox provided.</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/2451.image_44F387CB.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/2451.image_5F00_44F387CB.png"><font size="3"></font></a><font size="3"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/4428.image_087B1321.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/4428.image_5F00_087B1321.png"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1362.image_thumb_26E5540A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1362.image_5F00_thumb_5F00_26E5540A.png" width="607" height="263" /></a></font><font size="3"> </font></p> <font size="3"></font>  <p><b></b><font size="3">Step 5. Now we need to create an outbound rule. To know how to create an outbound rule, look at the following link</font></p> <font size="3"></font>  <p><a href="https://www.iis.net/learn/extensions/url-rewrite-module/creating-outbound-rules-for-url-rewrite-module"><font size="3">https://www.iis.net/learn/extensions/url-rewrite-module/creating-outbound-rules-for-url-rewrite-module</font></a></p> <font size="3"></font>  <p><b></b><font size="3">Step 6. Create an Outbound rule as the following.</font></p> <font size="3"></font>  <p><b><font size="3">       <br /></font><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/6116.image_5FD3A7AB.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/6116.image_5F00_5FD3A7AB.png"><font size="3"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/14/metablogapi/1030.image_thumb_32DE44D0.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-14-metablogapi/1030.image_5F00_thumb_5F00_32DE44D0.png" width="591" height="583" /></font></a><font size="3"> </font></b></p> <font size="3"></font>  <p><font size="3">Please note that this is a website-specific rule. If you want to create the rule for all of your applications, create the rule at the server level. Also, some applications, especially third party applications, may require the x-aspnet-version header, so you may need to remove this rule for those applications.</font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>]]></content:encoded>
    </item>
  </channel>
</rss>