<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Care, Share and Grow! : Client Certificate</title><link>http://blogs.msdn.com/saurabh_singh/archive/tags/Client+Certificate/default.aspx</link><description>Tags: Client Certificate</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Required permissions when calling a Web service using client certificate for authentication in an ASP.NET Web application</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/07/03/required-permissions-when-calling-a-web-service-using-client-certificate-for-authentication-in-an-asp-net-web-application.aspx</link><pubDate>Fri, 03 Jul 2009 04:08:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9815515</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9815515.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9815515</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9815515</wfw:comment><description>&lt;p&gt;A Web service requiring Client certificate authentication is a common scenario.&lt;/p&gt; &lt;p&gt;You may have a client application which needs to send the Client certificate as part of the web request for accessing the web service.&lt;/p&gt; &lt;p&gt;This client application may be a Windows/Console application or another Web application.&lt;/p&gt; &lt;p&gt;Often you will get into issues wherein you are able to send Client certificate as part of the web request from a windows/console app but not from another web app. The primary reason for this could often be around Web app not being able to send the client cert to the target Web service.&lt;/p&gt; &lt;p&gt;This can happen for multiple reasons, in particular account under which Web app is running doesn't have enough permissions to access the Client cert in its local certificate store.&lt;/p&gt; &lt;p&gt;Refer to this excellent &lt;a title="901183" href="http://support.microsoft.com/?id=901183" target="_blank"&gt;kb&lt;/a&gt; for this for more details.&lt;/p&gt; &lt;p&gt;In this post I want to highlight ways in which you can grant access to the Web application account to access the Client certificate in its local machine store.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;When we have to send client cert as part of the web service call from a web app we need to ensure that the client cert is installed in the Local Computer -&amp;gt; Personal Store on the local box (where Web app is running). By default you will see the client cert installed in the Local User Store for the user who requested and installed the cert on the machine. You need to ensure first that the client cert is installed on the Local Computer Store instead of the Local User Store and then follow any of the methods below to grant access to the private key for the account (under which your web app is running).&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Method 1:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The above article &lt;a title="901183" href="http://support.microsoft.com/?id=901183" target="_blank"&gt;kb&lt;/a&gt; gives an example of granting access using the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=c42e27ac-3409-40e9-8667-c748e422833f&amp;amp;displaylang=en" target="_blank"&gt;Microsoft Windows HTTP Services Certificate Configuration Tool&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;b&gt;&lt;/b&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;b&gt;&amp;gt; WinHttpCertCfg.exe -g -c LOCAL_MACHINE\MY -s " &lt;var&gt;IssuedToName &lt;/var&gt;" -a " &lt;var&gt;AccountName &lt;/var&gt;"&lt;/b&gt;&lt;/p&gt; &lt;p&gt;for e.g. &lt;/p&gt; &lt;p&gt;&lt;b&gt;&amp;gt; WinHttpCertCfg.exe -g -c LOCAL_MACHINE\MY -s " &lt;var&gt;IssuedToName &lt;/var&gt;" -a "Network Service" &lt;/b&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;There are other ways in which you can achieve the same result. This feature is in fact built in on Windows Server 2008 within the Certificate mmc console.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Method 2:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Using the WSE X509 Certificate tool (This tool has features that can be used to check certificate properties).&lt;/p&gt; &lt;p&gt;You need to &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=1ba1f631-c3e7-420a-bc1e-ef18bab66122&amp;amp;displaylang=en" target="_blank"&gt;download&lt;/a&gt; Web Services enhancements (WSE) 2.0+ SP3 for Microsoft.Net and in the install wizard ensure you select Tools as shown below:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4e6e8ea9250e_4A38/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="381" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4e6e8ea9250e_4A38/image_thumb.png" width="504" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Once installed go ahead and launch the tool. It has a clean UI. You have the option to check certificates in the Local Computer/Current user for the available stores like Personal/Trusted/Intermediate Root CA etc. If you click on View Private Key File Properties (shown below) you can directly modify the permission for private key associated with the certificate. Basically this is just a file under &lt;em&gt;C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys&lt;/em&gt; on Win2k3 server and&amp;nbsp; &lt;em&gt;C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys&lt;/em&gt; on Win2k8 server.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4e6e8ea9250e_4A38/image_10.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="539" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4e6e8ea9250e_4A38/image_thumb_4.png" width="551" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;You may want to go ahead and give the Service account under which the web app is running Full permission on this file (modify the permissions from the Security tab).&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Method 3:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;If you are running the web app on Windows Server 2008/Vista there is a far simpler way built in the Certificate mmc.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4e6e8ea9250e_4A38/image_12.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="312" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4e6e8ea9250e_4A38/image_thumb_5.png" width="572" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Right click on the certificate and go to All Tasks -&amp;gt; Manage Private Keys and then give Full permission for the associated account.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Till next time..&lt;/p&gt; &lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9815515" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/ASP.Net/default.aspx">ASP.Net</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Client+Certificate/default.aspx">Client Certificate</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Setup/default.aspx">Setup</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category></item><item><title>Avoid this confusion around Client certificate mapping in IIS 6.0/7.0</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/06/13/avoid-this-confusion-around-client-certificate-mapping-in-iis-6-0-7-0.aspx</link><pubDate>Sat, 13 Jun 2009 03:05:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9740648</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9740648.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9740648</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9740648</wfw:comment><description>&lt;p&gt;I just wanted to add this quick post around &lt;strong&gt;Client certificate Mapping&lt;/strong&gt; on IIS. This is focused on 1-to-1/Many-to-1 mapping in IIS 6.0/7.0.&lt;/p&gt; &lt;p&gt;If you are interested to know more about configuring Client certificate mapping in IIS 6.0 please check this &lt;a href="http://blogs.msdn.com/saurabh_singh/archive/2007/04/14/how-to-setup-iis-and-ad-for-client-certificate-setup-and-authentication.aspx" target="_blank"&gt;post&lt;/a&gt; of mine and for IIS 7.0 this is an excellent &lt;a href="http://blogs.iis.net/rlucero/archive/2008/05/23/iis-7-walkthrough-one-to-one-client-certificate-mapping-configuration.aspx" target="_blank"&gt;article&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;Recently a &lt;a href="http://blogs.msdn.com/rakkimk/" target="_blank"&gt;colleague&lt;/a&gt; of mine and I was working on this issue for one of our internal teams and after some real slogging we figured out that one *cannot* set this mapping at any Virtual directory/Application level in IIS.&lt;/p&gt; &lt;p&gt;One has to set the Client certificate mapping at the specific Web site level only!&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/7535c5fca462_4A3D/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="41" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/7535c5fca462_4A3D/image_thumb.png" width="149" border="0"&gt;&lt;/a&gt; This is wrong!&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/7535c5fca462_4A3D/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="39" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/7535c5fca462_4A3D/image_thumb_1.png" width="144" border="0"&gt;&lt;/a&gt; This is right!&lt;/p&gt; &lt;p&gt;I couldn't find a documentation on this so thought of putting this as a short post for general audience in case someone is scratching their head over this.&lt;/p&gt; &lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9740648" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Client+Certificate/default.aspx">Client Certificate</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Authentication/default.aspx">Authentication</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category></item><item><title>Automate client certificate one-to-one mapping in IIS 6.0 using C#</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/04/11/automate-client-certificate-one-to-one-mapping-in-iis-6-0-using-c.aspx</link><pubDate>Sat, 11 Apr 2009 03:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9544308</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>23</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9544308.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9544308</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9544308</wfw:comment><description>&lt;P&gt;In PSS, we occasionally get requests from our customers wherein they want to automatically add entries for client certificate mapping in IIS or Active Directory (AD). That is either a 1-to-1, Many-to-1 or AD mapping for the client certificate authentication for the web site. I recommend going with AD mapping because that eases the management but it finally depends upon one's need.&lt;/P&gt;
&lt;P&gt;I am not sure but I feel there is a security breach plus annoyance when an administrator has to laboriously enter the mappings for all the accounts/certificates (I am being specific to 1-to-1/Many-to-1 here). &lt;/P&gt;
&lt;P&gt;The concern I feel when dealing with the administrator doing it for 1-to-1 and Many-to-1 are:&lt;/P&gt;
&lt;P&gt;a. If there are hundreds of users you need to do this manually for everyone of those accounts and it's a pain.&lt;/P&gt;
&lt;P&gt;b. Yes, the above can be automated using a script but then the second concern that arises is that whoever is running the script has to know the passwords for all these accounts to be mapped. I think this doesn't sound good.&lt;/P&gt;
&lt;P&gt;I have written a sample application using which users can enter the mappings themselves in the IIS's Client certificate setting, i.e. entries having the client certificate mapped to a windows account (either a local IIS or AD account) and the corresponding password. &lt;/P&gt;
&lt;P&gt;So this is how it works:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;User accesses this web page from their workstation which already has the client certificate installed. 
&lt;LI&gt;They are authenticated over Basic with SSL. 
&lt;LI&gt;Browser sends across the client certificate as part of the HTTP web request. 
&lt;LI&gt;This application gathers the user account, password plus the client certificate from the incoming HTTP web request and does the mapping in IIS.&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b5fb3b4c2db3_3557/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b5fb3b4c2db3_3557/image_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=760 alt=image src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b5fb3b4c2db3_3557/image_thumb.png" width=617 border=0 mce_src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b5fb3b4c2db3_3557/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;I am adding the code here in case someone may want to extract the section for automated scripting instead of using it as a web app.&lt;/P&gt;
&lt;P&gt;This code is also attached to this post as well.&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 8pt; PADDING-BOTTOM: 4px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 97.5%; CURSOR: text; MAX-HEIGHT: 200px; LINE-HEIGHT: 12pt; PADDING-TOP: 4px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BACKGROUND-COLOR: #f4f4f4"&gt;
&lt;DIV style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Data;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Configuration;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Web;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Web.Security;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Security.Cryptography.X509Certificates;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Web.UI;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Web.UI.WebControls;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Web.UI.WebControls.WebParts;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Web.UI.HtmlControls;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.DirectoryServices;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;/* This sample application is to automate One-to-One Client certificate mapping in IIS 6.0.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * User should be able to access this site from the browser and select the client certificate&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * in their machine which will be mapped to their account on the IIS server for 1-to-1 mapping. &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * You need to deploy this application on the IIS server which is hosting the website(s) which &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * needs client certificate mapping, preferably under its own virtual directory.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * Important:&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * - Have the authentication for this web application configured to use Basic along with SSL.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * - Have the "Accept client certificates" or "Require client certificates" selected under &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   &amp;lt;Website&amp;gt; -&amp;gt; Properties -&amp;gt; Directory Security -&amp;gt; Secure communications -&amp;gt; Edit -&amp;gt; Client certificates&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * - Ensure the website that we want the mapping for is mentioned in the web.config file associated with&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   this application under &amp;lt;appSettings&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * - In the Web.config file we are impersonating an Administrator account for this application. &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   &amp;lt;identity impersonate="true" userName="Administrator" password="myadminpassword"/&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   This is done because non-admin users cannot modify the IIS metabase. If you do not want users to map&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   entries themselves through web page you can change this to &amp;lt;identity impersonate="true" /&amp;gt;.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   In such a case only admins can add the mappings for their user accounts. Non-admins won't be able to &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   add the client mapping entries.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   This is valid for both domain or local Windows NT accounts.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * - This app is written using .Net 2.0, ASP.Net 2.0 and above in mind. You should be able to make it work&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   with ASP.Net 1.1 as well.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * - You may prefer to run this application under its own dedicated application pool to ensure stability and security.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * DISCLAIMER: The code is not tested for production scenarios so use it at your own risk. &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *             In case one wants to use batch scripting etc or some kind of console app instead &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *             of web app you can extract the code section from this page which should work fine for the job.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; */&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;partial&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; _Default : System.Web.UI.Page &lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;{&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;protected&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Page_Load(&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt; sender, EventArgs e)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;      {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;B&amp;gt;Client Certificate One-to-One Mapping Application:&amp;lt;/B&amp;gt;&amp;lt;BR&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Serial number: "&lt;/SPAN&gt; + Request.ClientCertificate.SerialNumber + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/BR&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Issuer: "&lt;/SPAN&gt; + Request.ClientCertificate.Issuer + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/BR&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Subject Name: "&lt;/SPAN&gt; + Request.ClientCertificate.Subject + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/BR&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (Request.ClientCertificate.IsPresent)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Validity&amp;lt;BR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Not before: "&lt;/SPAN&gt; + Request.ClientCertificate.ValidFrom + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/BR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Not after: "&lt;/SPAN&gt; + Request.ClientCertificate.ValidUntil + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/BR&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;B&amp;gt;There is no client certificate sent along with the request!&amp;lt;/B&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Authenticated User: "&lt;/SPAN&gt; + Request.ServerVariables[&lt;SPAN style="COLOR: #006080"&gt;"AUTH_USER"&lt;/SPAN&gt;] + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/BR&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Authentication Type: "&lt;/SPAN&gt; + Request.ServerVariables[&lt;SPAN style="COLOR: #006080"&gt;"AUTH_TYPE"&lt;/SPAN&gt;] + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/BR&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;    }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;protected&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Button1_Click(&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt; sender, EventArgs e)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;    {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; user = Request.ServerVariables[&lt;SPAN style="COLOR: #006080"&gt;"AUTH_USER"&lt;/SPAN&gt;];&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; password = Request.ServerVariables[&lt;SPAN style="COLOR: #006080"&gt;"AUTH_PASSWORD"&lt;/SPAN&gt;];&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; clientCertMappingName = &lt;SPAN style="COLOR: #006080"&gt;"Mapping for "&lt;/SPAN&gt; + user;  &lt;SPAN style="COLOR: #008000"&gt;// &amp;lt;--- Our One-to-One Mapping name for the entry&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        HttpClientCertificate cert = Request.ClientCertificate;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #008000"&gt;/*&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;          If you want to map a client certificate located on the disk instead of the one as part of the &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;          HTTP Web request try the code below.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;          &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;          X509Certificate certificate = X509Certificate2.CreateFromCertFile(@"c:\cert.cer");&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;          X509Certificate certificate = cert.Certificate;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;          byte[] certHash = certificate.GetRawCertData();&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;        */&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;byte&lt;/SPAN&gt;[] certHash = Request.ClientCertificate.Certificate;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #008000"&gt;//Get the name of the Web site for which mapping has to be done from the App settings in the web.config file.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; friendlyWebsiteName = ConfigurationManager.AppSettings[&lt;SPAN style="COLOR: #006080"&gt;"websitename"&lt;/SPAN&gt;].ToString();&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #008000"&gt;//Get the Site Identifier based on the friendly name of the Web Site.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; siteId = getsiteid(friendlyWebsiteName);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (siteId != &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; sitePath = &lt;SPAN style="COLOR: #006080"&gt;"IIS://localhost/W3SVC/"&lt;/SPAN&gt; + siteId + &lt;SPAN style="COLOR: #006080"&gt;"/IIsCertMapper"&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; (DirectoryEntry de = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; DirectoryEntry(sitePath))&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;                de.Invoke(&lt;SPAN style="COLOR: #006080"&gt;"CreateMapping"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;[] { certHash, user, password, clientCertMappingName, &lt;SPAN style="COLOR: #0000ff"&gt;true&lt;/SPAN&gt; });&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Account Mapped: &amp;lt;B&amp;gt;"&lt;/SPAN&gt; + Request.ServerVariables[&lt;SPAN style="COLOR: #006080"&gt;"AUTH_USER"&lt;/SPAN&gt;] + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/B&amp;gt;&amp;lt;/BR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Mapping Name: &amp;lt;B&amp;gt;"&lt;/SPAN&gt; + &lt;SPAN style="COLOR: #006080"&gt;"Mapping for "&lt;/SPAN&gt; + Request.ServerVariables[&lt;SPAN style="COLOR: #006080"&gt;"AUTH_USER"&lt;/SPAN&gt;] + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/B&amp;gt;&amp;lt;/BR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Web Site: &amp;lt;B&amp;gt;"&lt;/SPAN&gt; + friendlyWebsiteName + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/B&amp;gt;&amp;lt;/BR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;B&amp;gt;Web Site does not have a valid Site ID. Ensure we have the correct site name in the config file for this app.&amp;lt;/B&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        &lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt; (System.Runtime.InteropServices.COMException)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"A COM exception occurred while setting up the mapping."&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt; (SystemException)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"An error occurred while setting up the mapping."&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt; (Exception)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"An error occurred while setting up the mapping."&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;       &lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;    }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; getsiteid(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; websitename)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;    {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        DirectoryEntry root = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; DirectoryEntry(&lt;SPAN style="COLOR: #006080"&gt;"IIS://localhost/W3SVC"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; siteid = &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;foreach&lt;/SPAN&gt; (DirectoryEntry de &lt;SPAN style="COLOR: #0000ff"&gt;in&lt;/SPAN&gt; root.Children)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;                &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (de.SchemaClassName == &lt;SPAN style="COLOR: #006080"&gt;"IIsWebServer"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;                {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;                    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (websitename.ToUpper() == de.Properties[&lt;SPAN style="COLOR: #006080"&gt;"ServerComment"&lt;/SPAN&gt;].Value.ToString().ToUpper())&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;                        siteid = de.Name;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;                }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (siteid == &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;) &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; siteid;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;finally&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            root.Close();&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;    }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;}&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ciao&lt;/P&gt;
&lt;P&gt;Nice weekend!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9544308" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/saurabh_singh/attachment/9544308.ashx" length="3384" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/ASP.Net/default.aspx">ASP.Net</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Client+Certificate/default.aspx">Client Certificate</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Code+Sample/default.aspx">Code Sample</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Tools/default.aspx">Tools</category></item><item><title>Unable to access IIsCertMapper object through ADSI</title><link>http://blogs.msdn.com/saurabh_singh/archive/2008/04/03/unable-to-access-iiscertmapper-object-through-adsi.aspx</link><pubDate>Thu, 03 Apr 2008 02:10:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8352615</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/8352615.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=8352615</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=8352615</wfw:comment><description>&lt;p&gt;Today, I was working on an issue where we were trying to add mapping for client certificate for a windows account using ADSI and VBScript. Something similar as below:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;lt;% &lt;br&gt;&amp;nbsp; Dim CertObj, vCert &lt;br&gt;&amp;nbsp; vCert = Request.ClientCertificate("CERTIFICATE") &lt;br&gt;&amp;nbsp; Set CertObj = GetObject("IIS://&amp;lt;path&amp;gt;/IIsCertMapper") &lt;br&gt;&amp;nbsp; CertObj.CreateMapping vCert, "MYACCT", "MYPASS", "My Name", True &lt;br&gt;%&amp;gt; &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;where path is in the format: "&amp;lt;IISServerName&amp;gt;/W3SVC/&amp;lt;Identifier&amp;gt;"&lt;br&gt;However, script was failing on the 3rd line, &lt;/p&gt; &lt;p&gt;Set CertObj = GetObject("IIS://&amp;lt;path&amp;gt;/IIsCertMapper") &lt;/p&gt; &lt;p&gt;We get “Path not found error”, 80070003. Now this is an expected behavior if this object type is not found in the IIS's metabase. You can search for the above in metabase.xml file. Ideally this should have been there, but since we did not have this, to make it work we had to manually create this for a website in question.&lt;/p&gt; &lt;p&gt;You can try this to have the necessary object type:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;gt; cscript adsutil.vbs CREATE w3svc/1/IIsCertMapper&amp;nbsp; "IIsCertMapper"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;p&gt;Microsoft (R) Windows Script Host Version 5.6  &lt;p&gt;Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.  &lt;p&gt;created "w3svc/1/IIsCertMapper"  &lt;p&gt;&amp;gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Here 1 is the identifier for the website in question and "IIsCertMapper" is the Object type.&lt;/p&gt; &lt;p&gt;Once done, try restarting IIS services as like (IISRESET from the cmd prompt).&lt;/p&gt; &lt;p&gt;Open the metabase.xml and now we should see an entry as below:&lt;/p&gt; &lt;p&gt;&amp;lt;IIsCertMapper&amp;nbsp;&amp;nbsp;&amp;nbsp; Location ="/LM/W3SVC/1/IIsCertMapper"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&lt;br&gt;&amp;lt;/IIsCertMapper&amp;gt;  &lt;p&gt;Once this entry was created in the metabase.xml we should be able to access this object via ADSI script. This is not only applicable to a specific object type like IIsCertMapper but any other object type associated with IIS.&lt;/p&gt; &lt;p&gt;Hope this helps someone, somewhere, somehow ;-)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8352615" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Client+Certificate/default.aspx">Client Certificate</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category></item><item><title>Certificate Trust List not being honored by IIS 5.0/6.0/7.0?</title><link>http://blogs.msdn.com/saurabh_singh/archive/2007/12/07/certificate-trust-list-not-being-honored-by-iis-5-0-6-0-7-0.aspx</link><pubDate>Sat, 08 Dec 2007 00:36:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6697278</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/6697278.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=6697278</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=6697278</wfw:comment><description>&lt;p&gt;Something one should be aware of if one is dealing with Client certificate and assuming Certificate Trust List (CTL) will limit the list of Trusted Certificate Authorities (CA's) being sent to the client during the initial SSL handshake.&lt;/p&gt; &lt;p&gt;In IIS 5.0 Post MS04-011 update and 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. i.e. 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.&lt;/p&gt; &lt;p&gt;This however is not applicable to Apache web server. Apache will send the list of CA's which are part of the CTL. The above behavior was implemented in IIS as a security design feature. You can use OpenSSL to check the behavior:&lt;/p&gt; &lt;p&gt;Let's assume we have a web site www.test.com which accepts client certificates. OpenSSL will show the following transaction. Note that it sends the list of all the CA's even if you have configured CTL to allow specific CA's.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;C:\&amp;gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;OpenSSL s_client -connect www.test.com:443 -prexit&lt;/strong&gt;&lt;br&gt;&lt;/font&gt;Loading 'screen' into random state - done&lt;br&gt;CONNECTED(00000790)&lt;br&gt;depth=0 /C=CA/ST=Karnataka/L=Bangalore/O=abc/OU=IIS/CN=www.test.com&lt;br&gt;verify error:num=20:unable to get local issuer certificate&lt;br&gt;verify return:1&lt;br&gt;depth=0 /C=CA/ST=Karnataka/L=Bangalore/O=abc/OU=IIS/CN=www.test.com&lt;br&gt;verify error:num=27:certificate not trusted&lt;br&gt;verify return:1&lt;br&gt;depth=0 /C=CA/ST=Karnataka/L=Bangalore/O=abc/OU=IIS/CN=www.test.com&lt;br&gt;verify error:num=21:unable to verify the first certificate&lt;br&gt;verify return:1&lt;br&gt;---&lt;br&gt;Certificate chain&lt;br&gt;0 s:/C=CA/ST=Karnataka/L=Bangalore/O=abc/OU=IIS/CN=www.test.com&lt;br&gt;&amp;nbsp;&amp;nbsp; i:/DC=com/DC=Saurabh1/CN=Microsoft&lt;br&gt;---&lt;br&gt;Server certificate&lt;br&gt;-----BEGIN CERTIFICATE-----&lt;br&gt;MIIE3DCCA8SgAwIBAgIKEfew+wAAAAAANTANBgkqhkiG9w0BAQUFADBDMRMwEQYK&lt;br&gt;CZImiZPyLGQBGRYDY29tMRgwFgYKCZImiZPyLGQBGRYIU2F1cmFiaDExEjAQBgNV&lt;br&gt;BAMTCU1pY3Jvc29mdDAeFw0wNzExMTYyMzE1MjFaFw0wOTExMTUyMzE1MjFaMGgx&lt;br&gt;CzAJBgNVBAYTAkNBMRIwEAYDVQQIEwlLYXJuYXRha2ExEjAQBgNVBAcTCUJhbmdh&lt;br&gt;bG9yZTEMMAoGA1UEChMDYWJjMQwwCgYDVQQLEwNJSVMxFTATBgNVBAMTDHd3dy50&lt;br&gt;ZXN0LmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyHwhBcSOgyfAe2WJ&lt;br&gt;2m391qWNTEKj9ScSKrbrzxEFWqEKIReH5pkabxG188vX1uQoo5MUCGd3WIEAb3Xa&lt;br&gt;T+mY7P/nA3fwMEUjF1apwXPwQf8hpx5GXhPM6YjyizFGxq06qgNTG3+gCh8arwhu&lt;br&gt;u8f9zKOEUicGDOJaQHIK1ofp4G8CAwEAAaOCAi8wggIrMAsGA1UdDwQEAwIFoDBE&lt;br&gt;BgkqhkiG9w0BCQ8ENzA1MA4GCCqGSIb3DQMCAgIAgDAOBggqhkiG9w0DBAICAIAw&lt;br&gt;BwYFKw4DAgcwCgYIKoZIhvcNAwcwEwYDVR0lBAwwCgYIKwYBBQUHAwEwHQYDVR0O&lt;br&gt;BBYEFBi8sz9sklijc8tObd/kfYp13IQXMB8GA1UdIwQYMBaAFAVRxGOV1iHL6wJC&lt;br&gt;f2vFzSTt5QFwMEUGA1UdHwQ+MDwwOqA4oDaGNGh0dHA6Ly9sYXhtaW5iLnNhdXJh&lt;br&gt;YmgxLmNvbS9DZXJ0RW5yb2xsL01pY3Jvc29mdC5jcmwwggEVBggrBgEFBQcBAQSC&lt;br&gt;AQcwggEDMIGpBggrBgEFBQcwAoaBnGxkYXA6Ly8vQ049TWljcm9zb2Z0LENOPUFJ&lt;br&gt;QSxDTj1QdWJsaWMlMjBLZXklMjBTZXJ2aWNlcyxDTj1TZXJ2aWNlcyxDTj1Db25m&lt;br&gt;aWd1cmF0aW9uLERDPVNhdXJhYmgxLERDPWNvbT9jQUNlcnRpZmljYXRlP2Jhc2U/&lt;br&gt;b2JqZWN0Q2xhc3M9Y2VydGlmaWNhdGlvbkF1dGhvcml0eTBVBggrBgEFBQcwAoZJ&lt;br&gt;aHR0cDovL2xheG1pbmIuc2F1cmFiaDEuY29tL0NlcnRFbnJvbGwvTEFYTUlOQi5T&lt;br&gt;YXVyYWJoMS5jb21fTWljcm9zb2Z0LmNydDAhBgkrBgEEAYI3FAIEFB4SAFcAZQBi&lt;br&gt;AFMAZQByAHYAZQByMA0GCSqGSIb3DQEBBQUAA4IBAQAPf48JnKDC5qnGUOwzPsVY&lt;br&gt;iz454kHCa6hWxO4L8Lf4uZ/iTwhjvG+LsPZpsijxAkpa/Me2YAtTJS8HaKa0l+on&lt;br&gt;VAsDl4AJLK0epH7iQUfahe5BH3DxYcXFi2uAZeSFa12STxa5Ywtknrlxelimzak+&lt;br&gt;CgEZTSUDTtSDAOxwIpIXlmsPzBmaI7Cx6+R0Kul3H+DPRP/iE/Qh7yzlXbDqcAsA&lt;br&gt;i91ungRcHtiFxkLSwfRbV/qyr2OszKa+7SM9GJ6R0lJC5oRBy/JkQqWiAYvRaf5J&lt;br&gt;iTdC7eourVL+TH+GhXnFpmCs+YlotkWLj7EsLKwKiEuX8mm8T6UXKzis2OazfHfh&lt;br&gt;-----END CERTIFICATE-----&lt;br&gt;subject=/C=CA/ST=Karnataka/L=Bangalore/O=abc/OU=IIS/CN=www.test.com&lt;br&gt;issuer=/DC=com/DC=Saurabh1/CN=Microsoft&lt;br&gt;---&lt;br&gt;No client certificate CA names sent&lt;br&gt;---&lt;br&gt;SSL handshake has read 1384 bytes and written 324 bytes&lt;br&gt;---&lt;br&gt;New, TLSv1/SSLv3, Cipher is RC4-MD5&lt;br&gt;Server public key is 1024 bit&lt;br&gt;SSL-Session:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Protocol&amp;nbsp; : TLSv1&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cipher&amp;nbsp;&amp;nbsp;&amp;nbsp; : RC4-MD5&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Session-ID: B21A0000950C415B75F380724109AE354A29437F77C62FCEF493BD823C62C616&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Session-ID-ctx:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Master-Key: 6A2F53DBE5ED1565D1E7CB218B4D1B7AF7CFE07594469D69772C26232BBB0253326ACC25A106D3A6B452&lt;br&gt;1B3B0989D57D&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Key-Arg&amp;nbsp;&amp;nbsp; : None&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start Time: 1197061986&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Timeout&amp;nbsp;&amp;nbsp; : 300 (sec)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Verify return code: 21 (unable to verify the first certificate)&lt;br&gt;---&lt;br&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;GET /test.asp&lt;/font&gt;&lt;br&gt;&lt;/strong&gt;depth=0 /C=CA/ST=Karnataka/L=Bangalore/O=abc/OU=IIS/CN=www.test.com&lt;br&gt;verify error:num=20:unable to get local issuer certificate&lt;br&gt;verify return:1&lt;br&gt;depth=0 /C=CA/ST=Karnataka/L=Bangalore/O=abc/OU=IIS/CN=www.test.com&lt;br&gt;verify error:num=27:certificate not trusted&lt;br&gt;verify return:1&lt;br&gt;depth=0 /C=CA/ST=Karnataka/L=Bangalore/O=abc/OU=IIS/CN=www.test.com&lt;br&gt;verify error:num=21:unable to verify the first certificate&lt;br&gt;verify return:1&lt;br&gt;read R BLOCK&lt;br&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "&lt;a href="http://www.w3.org/TR/html4/strict.dtd&amp;quot;"&gt;http://www.w3.org/TR/html4/strict.dtd"&lt;/a&gt;&amp;gt;&lt;br&gt;&amp;lt;HTML&amp;gt;&amp;lt;HEAD&amp;gt;&amp;lt;TITLE&amp;gt;The page requires a client certificate&amp;lt;/TITLE&amp;gt;&lt;br&gt;&amp;lt;META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252"&amp;gt;&lt;br&gt;&amp;lt;STYLE type="text/css"&amp;gt;&lt;br&gt;&amp;nbsp; BODY { font: 8pt/12pt verdana }&lt;br&gt;&amp;nbsp; H1 { font: 13pt/15pt verdana }&lt;br&gt;&amp;nbsp; H2 { font: 8pt/12pt verdana }&lt;br&gt;&amp;nbsp; A:link { color: red }&lt;br&gt;&amp;nbsp; A:visited { color: maroon }&lt;br&gt;&amp;lt;/STYLE&amp;gt;&lt;br&gt;&amp;lt;/HEAD&amp;gt;&amp;lt;BODY&amp;gt;&amp;lt;TABLE width=500 border=0 cellspacing=10&amp;gt;&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;  &lt;p&gt;&amp;lt;h1&amp;gt;The page requires a client certificate&amp;lt;/h1&amp;gt;&lt;br&gt;The page you are attempting to access requires your browser to have a Secure Sockets Layer (SSL) cli&lt;br&gt;ent certificate that the Web server will recognize. The client certificate is used for identifying y&lt;br&gt;ou as a valid user of the resource.&lt;br&gt;&amp;lt;hr&amp;gt;&lt;br&gt;&amp;lt;p&amp;gt;Please try the following:&amp;lt;/p&amp;gt;&lt;br&gt;&amp;lt;ul&amp;gt;&lt;br&gt;&amp;lt;li&amp;gt;Contact the Web site administrator if you believe you should be able to view this directory or p&lt;br&gt;age without a client certificate, or to obtain a client certificate.&amp;lt;/li&amp;gt;&lt;br&gt;&amp;lt;li&amp;gt;If you already have a client certificate, use your Web browser's security features to ensure tha&lt;br&gt;t your client certificate is installed properly. (Some Web browsers refer&lt;br&gt;to client certificates as browser or personal certificates.)&amp;lt;/li&amp;gt;&lt;br&gt;&amp;lt;/ul&amp;gt;&lt;br&gt;&amp;lt;h2&amp;gt;HTTP Error 403.7 - Forbidden: SSL client certificate is required.&amp;lt;br&amp;gt;Internet Information Servic&lt;br&gt;es (IIS)&amp;lt;/h2&amp;gt;&lt;br&gt;&amp;lt;hr&amp;gt;&lt;br&gt;&amp;lt;p&amp;gt;Technical Information (for support personnel)&amp;lt;/p&amp;gt;&lt;br&gt;&amp;lt;ul&amp;gt;&lt;br&gt;&amp;lt;li&amp;gt;Go to &amp;lt;a href="&lt;a href="http://go.microsoft.com/fwlink/?linkid=8180&amp;quot;"&gt;http://go.microsoft.com/fwlink/?linkid=8180"&lt;/a&gt;&amp;gt;Microsoft Product Support Services&amp;lt;/&lt;br&gt;a&amp;gt; and perform a title search for the words &amp;lt;b&amp;gt;HTTP&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;403&amp;lt;/b&amp;gt;.&amp;lt;/li&amp;gt;&lt;br&gt;&amp;lt;li&amp;gt;Open &amp;lt;b&amp;gt;IIS Help&amp;lt;/b&amp;gt;, which is accessible in IIS Manager (inetmgr),&lt;br&gt;and search for topics titled &amp;lt;b&amp;gt;About Certificates&amp;lt;/b&amp;gt;, &amp;lt;b&amp;gt;Using Certificate Trust Lists&amp;lt;/b&amp;gt;, &amp;lt;b&amp;gt;En&lt;br&gt;abling Client Certificates&amp;lt;/b&amp;gt;, and &amp;lt;b&amp;gt;About Custom Error Messages&amp;lt;/b&amp;gt;.&amp;lt;/li&amp;gt;&lt;br&gt;&amp;lt;/ul&amp;gt;  &lt;p&gt;&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&amp;lt;/TABLE&amp;gt;&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;  &lt;p&gt;read:errno=0&lt;br&gt;---&lt;br&gt;Certificate chain&lt;br&gt;0 s:/C=CA/ST=Karnataka/L=Bangalore/O=abc/OU=IIS/CN=www.test.com&lt;br&gt;&amp;nbsp;&amp;nbsp; i:/DC=com/DC=Saurabh1/CN=Microsoft&lt;br&gt;---&lt;br&gt;Server certificate&lt;br&gt;-----BEGIN CERTIFICATE-----&lt;br&gt;MIIE3DCCA8SgAwIBAgIKEfew+wAAAAAANTANBgkqhkiG9w0BAQUFADBDMRMwEQYK&lt;br&gt;CZImiZPyLGQBGRYDY29tMRgwFgYKCZImiZPyLGQBGRYIU2F1cmFiaDExEjAQBgNV&lt;br&gt;BAMTCU1pY3Jvc29mdDAeFw0wNzExMTYyMzE1MjFaFw0wOTExMTUyMzE1MjFaMGgx&lt;br&gt;CzAJBgNVBAYTAkNBMRIwEAYDVQQIEwlLYXJuYXRha2ExEjAQBgNVBAcTCUJhbmdh&lt;br&gt;bG9yZTEMMAoGA1UEChMDYWJjMQwwCgYDVQQLEwNJSVMxFTATBgNVBAMTDHd3dy50&lt;br&gt;ZXN0LmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyHwhBcSOgyfAe2WJ&lt;br&gt;2m391qWNTEKj9ScSKrbrzxEFWqEKIReH5pkabxG188vX1uQoo5MUCGd3WIEAb3Xa&lt;br&gt;T+mY7P/nA3fwMEUjF1apwXPwQf8hpx5GXhPM6YjyizFGxq06qgNTG3+gCh8arwhu&lt;br&gt;u8f9zKOEUicGDOJaQHIK1ofp4G8CAwEAAaOCAi8wggIrMAsGA1UdDwQEAwIFoDBE&lt;br&gt;BgkqhkiG9w0BCQ8ENzA1MA4GCCqGSIb3DQMCAgIAgDAOBggqhkiG9w0DBAICAIAw&lt;br&gt;BwYFKw4DAgcwCgYIKoZIhvcNAwcwEwYDVR0lBAwwCgYIKwYBBQUHAwEwHQYDVR0O&lt;br&gt;BBYEFBi8sz9sklijc8tObd/kfYp13IQXMB8GA1UdIwQYMBaAFAVRxGOV1iHL6wJC&lt;br&gt;f2vFzSTt5QFwMEUGA1UdHwQ+MDwwOqA4oDaGNGh0dHA6Ly9sYXhtaW5iLnNhdXJh&lt;br&gt;YmgxLmNvbS9DZXJ0RW5yb2xsL01pY3Jvc29mdC5jcmwwggEVBggrBgEFBQcBAQSC&lt;br&gt;AQcwggEDMIGpBggrBgEFBQcwAoaBnGxkYXA6Ly8vQ049TWljcm9zb2Z0LENOPUFJ&lt;br&gt;QSxDTj1QdWJsaWMlMjBLZXklMjBTZXJ2aWNlcyxDTj1TZXJ2aWNlcyxDTj1Db25m&lt;br&gt;aWd1cmF0aW9uLERDPVNhdXJhYmgxLERDPWNvbT9jQUNlcnRpZmljYXRlP2Jhc2U/&lt;br&gt;b2JqZWN0Q2xhc3M9Y2VydGlmaWNhdGlvbkF1dGhvcml0eTBVBggrBgEFBQcwAoZJ&lt;br&gt;aHR0cDovL2xheG1pbmIuc2F1cmFiaDEuY29tL0NlcnRFbnJvbGwvTEFYTUlOQi5T&lt;br&gt;YXVyYWJoMS5jb21fTWljcm9zb2Z0LmNydDAhBgkrBgEEAYI3FAIEFB4SAFcAZQBi&lt;br&gt;AFMAZQByAHYAZQByMA0GCSqGSIb3DQEBBQUAA4IBAQAPf48JnKDC5qnGUOwzPsVY&lt;br&gt;iz454kHCa6hWxO4L8Lf4uZ/iTwhjvG+LsPZpsijxAkpa/Me2YAtTJS8HaKa0l+on&lt;br&gt;VAsDl4AJLK0epH7iQUfahe5BH3DxYcXFi2uAZeSFa12STxa5Ywtknrlxelimzak+&lt;br&gt;CgEZTSUDTtSDAOxwIpIXlmsPzBmaI7Cx6+R0Kul3H+DPRP/iE/Qh7yzlXbDqcAsA&lt;br&gt;i91ungRcHtiFxkLSwfRbV/qyr2OszKa+7SM9GJ6R0lJC5oRBy/JkQqWiAYvRaf5J&lt;br&gt;iTdC7eourVL+TH+GhXnFpmCs+YlotkWLj7EsLKwKiEuX8mm8T6UXKzis2OazfHfh&lt;br&gt;-----END CERTIFICATE-----&lt;br&gt;subject=/C=CA/ST=Karnataka/L=Bangalore/O=abc/OU=IIS/CN=www.test.com&lt;br&gt;issuer=/DC=com/DC=Saurabh1/CN=Microsoft&lt;br&gt;---&lt;br&gt;&lt;strong&gt;Acceptable client certificate CA names&lt;/strong&gt;&lt;br&gt;&lt;font color="#ff0000"&gt;/DC=com/DC=Saurabh1/CN=Microsoft&lt;br&gt;/DC=com/DC=Saurabh1/CN=Saurabh CA&lt;br&gt;/C=US/O=VeriSign, Inc./OU=Class 1 Public Primary Certification Authority - G2/OU=(c) 1998 VeriSign,&lt;br&gt;Inc. - For authorized use only/OU=VeriSign Trust Network&lt;br&gt;/C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority - G2/OU=(c) 1998 VeriSign,&lt;br&gt;Inc. - For authorized use only/OU=VeriSign Trust Network&lt;br&gt;/C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting/OU=Certification Services Division/CN=Thawte P&lt;br&gt;ersonal Freemail CA/emailAddress=personal-freemail@thawte.com&lt;br&gt;/C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting/OU=Certification Services Division/CN=Thawte P&lt;br&gt;ersonal Premium CA/emailAddress=personal-premium@thawte.com&lt;br&gt;/C=US/O=First Data Digital Certificates Inc./CN=First Data Digital Certificates Inc. Certification A&lt;br&gt;uthority&lt;br&gt;/C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting/OU=Certification Services Division/CN=Thawte P&lt;br&gt;ersonal Basic CA/emailAddress=personal-basic@thawte.com&lt;br&gt;/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority&lt;br&gt;/C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority&lt;br&gt;/C=US/O=VeriSign, Inc./OU=Class 1 Public Primary Certification Authority&lt;br&gt;/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority - G2/OU=(c) 1998 VeriSign,&lt;br&gt;Inc. - For authorized use only/OU=VeriSign Trust Network&lt;br&gt;/C=HU/L=Budapest/O=NetLock Halozatbiztonsagi Kft./OU=Tanusitvanykiadok/CN=NetLock Uzleti (Class B) T&lt;br&gt;anusitvanykiado&lt;br&gt;/C=US/O=GTE Corporation/CN=GTE CyberTrust Root&lt;br&gt;/C=US/O=GTE Corporation/OU=GTE CyberTrust Solutions, Inc./CN=GTE CyberTrust Global Root&lt;br&gt;/C=US/O=Entrust.net/OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Li&lt;br&gt;mited/CN=Entrust.net Secure Server Certification Authority&lt;br&gt;/C=HU/ST=Hungary/L=Budapest/O=NetLock Halozatbiztonsagi Kft./OU=Tanusitvanykiadok/CN=NetLock Kozjegy&lt;br&gt;zoi (Class A) Tanusitvanykiado&lt;br&gt;/C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority - G2/OU=(c) 1998 VeriSign,&lt;br&gt;Inc. - For authorized use only/OU=VeriSign Trust Network&lt;br&gt;/C=US/O=GTE Corporation/OU=GTE CyberTrust Solutions, Inc./CN=GTE CyberTrust Root&lt;br&gt;/C=HU/L=Budapest/O=NetLock Halozatbiztonsagi Kft./OU=Tanusitvanykiadok/CN=NetLock Expressz (Class C)&lt;br&gt;Tanusitvanykiado&lt;br&gt;/OU=Copyright (c) 1997 Microsoft Corp./OU=Microsoft Corporation/CN=Microsoft Root Authority&lt;br&gt;/DC=com/DC=microsoft/CN=Microsoft Root Certificate Authority&lt;/font&gt;&lt;br&gt;---&lt;br&gt;SSL handshake has read 7991 bytes and written 740 bytes&lt;br&gt;---&lt;br&gt;New, TLSv1/SSLv3, Cipher is RC4-MD5&lt;br&gt;Server public key is 1024 bit&lt;br&gt;SSL-Session:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Protocol&amp;nbsp; : TLSv1&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cipher&amp;nbsp;&amp;nbsp;&amp;nbsp; : RC4-MD5&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Session-ID: 7F0A00002D0024D14CCB9D959D185669A22B6F9ECF613E75C0B9A7DD75DD436A&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Session-ID-ctx:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Master-Key: A17E388F8744B03CAA268418A700F92B5BABDBD09908F8E5503B299579CA4C09A93CCEC5BBCB7BD2F39A&lt;br&gt;2C64EF36F674&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Key-Arg&amp;nbsp;&amp;nbsp; : None&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start Time: 1197061993&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Timeout&amp;nbsp;&amp;nbsp; : 300 (sec)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Verify return code: 21 (unable to verify the first certificate)&lt;br&gt;---  &lt;p&gt;This is the default behavior for IIS 5.0 (Post MS04-011), IIS 6.0 and to my knowledge will remain so going forward with IIS 7.0 as well. &lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6697278" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Client+Certificate/default.aspx">Client Certificate</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/SSL/default.aspx">SSL</category></item><item><title>Client Certificate revisited....How to troubleshoot client certificate related issues</title><link>http://blogs.msdn.com/saurabh_singh/archive/2007/06/09/client-certificate-revisited-how-to-troubleshoot-client-certificate-related-issues.aspx</link><pubDate>Sat, 09 Jun 2007 19:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3185914</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>20</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/3185914.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=3185914</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=3185914</wfw:comment><description>&lt;p&gt;Well, I am back to Client certificate again, guess the reason being a lot of support calls that we getting off late&amp;nbsp;are related to any of the following four errors, especially the first two.&lt;/p&gt;
&lt;p&gt;403.7&lt;/p&gt;
&lt;p&gt;403.13&lt;/p&gt;
&lt;p&gt;403.16 &lt;/p&gt;
&lt;p&gt;403.17 ( I will cover .16 and .17 very briefly since they are very self-explanatory and easy to troubleshoot)&lt;/p&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/saurabh_singh/archive/2007/04/14/how-to-setup-iis-and-ad-for-client-certificate-setup-and-authentication.aspx" mce_href="http://blogs.msdn.com/saurabh_singh/archive/2007/04/14/how-to-setup-iis-and-ad-for-client-certificate-setup-and-authentication.aspx"&gt;Earlier I had discussed the setup of the client certificate with IIS and AD for authentication mapping etc&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here I will discuss the troubleshooting strategies on client certificate related errors that are listed above.&lt;/p&gt;
&lt;p&gt;To understand how Client certificate is used while accessing a resource on the server, you may prefer to look at this&amp;nbsp;brief but&amp;nbsp;quite explanatory&amp;nbsp;KB by David Dietz&amp;nbsp;from IIS support.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/907274/en-us" title="http://support.microsoft.com/kb/907274/en-us" mce_href="http://support.microsoft.com/kb/907274/en-us"&gt;http://support.microsoft.com/kb/907274/en-us&lt;/a&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So here we go...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;1) 403.7&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We see that 403.7 can be thrown by IIS when Client certificate is required and the browser is not sending the client certificate details to the web server (IIS). Either the client did not send the certificate for some reason or else the client did not have a certificate issued by a CA that was also trusted by IIS server. If the client sends a certificate which is not mutually trusted by both client and the server you may see this error.&lt;/p&gt;
&lt;p&gt;You may get a meaningful error like this in the browser:&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000"&gt;HTTP Error 403 403.7 Forbidden: &lt;/font&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;Client&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff0000"&gt; &lt;/font&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;certificate&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff0000"&gt; required &lt;br&gt;This error occurs when the resource you are attempting to access requires your browser to have a &lt;/font&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;client&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff0000"&gt; Secure Sockets Layer (SSL) &lt;/font&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;certificate&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff0000"&gt; that the server recognizes. This is used for authenticating you as a valid user of the resource. &lt;br&gt;Please contact the Web server's administrator to obtain a valid &lt;/font&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;client&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff0000"&gt; &lt;/font&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;certificate&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff0000"&gt;.&lt;/font&gt; &lt;/p&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To start with, follow this KB &lt;a href="http://support.microsoft.com/kb/332077/en-us" title="http://support.microsoft.com/kb/332077/en-us" mce_href="http://support.microsoft.com/kb/332077/en-us"&gt;http://support.microsoft.com/kb/332077/en-us&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You need to make sure that the client certificate is issued by a CA which is in the trusted root CA store on both the server and the client machine. Confirm whether the trusted root CA is part of CTL. The reason being that if your certificate's CA is not in the CTL; although present in the trusted root CA store in the server machine, you may still see the error.&lt;/li&gt;&lt;/ul&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A CTL is a list of trusted certification authorities (CAs) that can be used for client authentication for a particular Web site . You can use CTLs to configure your Web server to accept certificates from a specific list of CAs, and automatically verify client certificates against this list. Only users with a client certificate that is issued by a CA in the CTL can gain access to the server. &lt;br&gt;Each Web site on your server can be configured to accept certificates from a different CTL. You may want to do this if you need a different list of trusted CAs for each Web site. 
&lt;/p&gt;&lt;p&gt;If CTL is present, this is the&amp;nbsp;list which is actually used to check for CA's which can issue client certificate to a user. If it is disabled then root CA store will be used for the above. Also make sure that the certificate is a valid client certificate. Make sure it is intended for user authentication.&lt;/p&gt;
&lt;p&gt;Check the certificate for "Ensures the identity of a remote computer" and Enhanced Key usage says &lt;a&gt;Client&lt;/a&gt; Authentication.&lt;/p&gt;
&lt;p&gt;Also Using &amp;gt;Certutil -verify -urlfetch should show:&lt;/p&gt;
&lt;p&gt;Verified Application Policies:&lt;br&gt;1.3.6.1.5.5.7.3.2 Client Authentication&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You may also see 403.7 due to an update to the trusted Root CA list. This creates a list that&amp;nbsp;is too large based on the size limit we enforce, the result being truncation of the list when this is sent to the &lt;a&gt;client&lt;/a&gt; during the &lt;a&gt;client&lt;/a&gt;&amp;nbsp;&lt;a&gt;certificate&lt;/a&gt; handshake. The limit is based on data size not CA count so there is no way to say this happens at a certain count of trusted CA’s.&lt;br&gt;To resolve this we need to delete some of the expired and unused/unknown trusted root certificates from the Trusted Root Certification Authorities list until it is working again.&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;The problem can also be identified when the following entry is logged on the Web server. It is quite explanatory in itself.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;font color="#ff0000"&gt;Event Type: Warning&lt;br&gt;Event Source: Schannel&lt;br&gt;Event Category: None&lt;br&gt;Event ID: 36885&lt;br&gt;Date: 2/9/2007&lt;br&gt;Time: 9:32:44 AM&lt;br&gt;User: N/A&lt;br&gt;Computer: USMASVGDOIM259&lt;br&gt;Description:&lt;br&gt;When asking for &lt;/font&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;client&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff0000"&gt; authentication, this server sends a list of trusted &lt;br&gt;&lt;/font&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;certificate&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff0000"&gt; authorities to the &lt;/font&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;client&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff0000"&gt;. The &lt;/font&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;client&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff0000"&gt; uses this list to choose a &lt;/font&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;client&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;certificate&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff0000"&gt; that is trusted by the server. Currently, this server trusts so many &lt;br&gt;&lt;/font&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;certificate&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff0000"&gt; authorities that the list has grown too long. This list has thus been &lt;br&gt;truncated. The administrator of this machine should review the &lt;/font&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;certificate&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;font color="#ff0000"&gt;authorities trusted for &lt;/font&gt;&lt;a&gt;&lt;font color="#ff0000"&gt;client&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff0000"&gt; authentication and remove those that do not really &lt;br&gt;need to be trusted.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Related articles:&lt;/p&gt;
&lt;p&gt;Trusted root certificates that are required by Windows Server 2003, by Windows XP, &lt;br&gt;and by Windows 2000&lt;br&gt;&lt;a href="http://support.microsoft.com/kb/293781" mce_href="http://support.microsoft.com/kb/293781"&gt;http://support.microsoft.com/kb/293781&lt;/a&gt;&lt;br&gt;931125 Microsoft root &lt;a&gt;certificate&lt;/a&gt; program members (January 2007)&lt;br&gt;&lt;a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;931125" mce_href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;931125"&gt;http://support.microsoft.com/default.aspx?scid=kb;EN-US;931125&lt;/a&gt;&lt;/p&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;2) 403.13&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The error you may see in the browser will be as shown below:&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000"&gt;HTTP 403.13 Forbidden: Client certificate revoked &lt;br&gt;The page requires a valid client certificate &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;For an understanding of this error message check KB 248058.&lt;/p&gt;
&lt;p&gt;This error message means that the client sent a certificate, but either the certificate shows up as revoked in the issuing authority's Certificate Revocation List or the server could not retrieve a CRL from the issuing authority.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You need to crosscheck whether the client certificate is revoked or not with the respective CA. 
&lt;/li&gt;&lt;li&gt;If CA&amp;nbsp;confirms the certificate as valid and not revoked then the issue could be with IIS being unable to retrieve CRL from the CA.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;IIS , by default retrieves a CRL whenever it receives a client cert to make sure that cert is not revoked as long as local cache&amp;nbsp;is expired. For this it contacts the CA to get the CRL which is a list of revoked certificates and compares the list with the presented client cert. If for any reason it cannot retrieve the CRL, it will go ahead and throw error message as 403.13 even if cert is valid and not revoked.&amp;nbsp; This can happen in cases where some Proxy/firewall may block access to CDP to get the CRLs.&lt;/p&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If a CDP extension is present in a certificate that is part of the certification path, &lt;a&gt;IIS&lt;/a&gt; must be able to download at least one of the CRLs. If &lt;a&gt;IIS&lt;/a&gt; is unable to resolve the CRL, it returns the HTTP 403.13 error. In this case, we cannot access the above CDP so we fail. Prior to MS04-011 Win2k did not limit validation based on this. However, we now require that the CDP be reachable when validating a certificate chain.&lt;br&gt;To work around this we must either use a reachable CDP in the client certificate or disable CertCheckMode on the &lt;a&gt;IIS&lt;/a&gt; server, thus preventing it from doing any revocation checking.&lt;/p&gt;
&lt;p&gt;So, if we are getting Client certificate revoked errors, then check to see if the server can get to the CRL distribution point specified in the client certificate and if it can and is still giving this error, then download the Root and Subordinate CA CRLs and install&amp;nbsp;them on the IIS server so that it can get to it locally. 
&lt;/p&gt;&lt;p&gt;Also there is a metabase key in IIS called certcheckmode, which if disabled will stop IIS from trying to retrieve CRL&amp;nbsp;checking. In such a case client cert will be accepted even if the cert is revoked. Disabling CRL checking is a quick way to test the cause. &lt;/p&gt;
&lt;p&gt;The CertCheckMode property enables or disables Certificate Revocation List (CRL) checking. When CertCheckMode is set to a value greater than 0 (CertCheckMode&amp;gt;0), the CRL does not search for certificates that have been revoked. When CertCheckMode is equal to 0 (CertCheckMode=0), the CRL searches for certificates that have been revoked. 
&lt;/p&gt;&lt;p&gt;With CertCheckMode disabled, &lt;a&gt;IIS&lt;/a&gt; will no longer try to verify revocation of incoming client certificate requests. The client certificates will still need to be within their valid dates and still must be trusted by the &lt;a&gt;IIS&lt;/a&gt; server (the &lt;a&gt;IIS&lt;/a&gt;&amp;nbsp;server must trust the issuing CA). 
&lt;/p&gt;&lt;p&gt;We disable the Certcheckmode key by setting it to 1.&lt;/p&gt;
&lt;p&gt;&amp;gt;&lt;b&gt;C:\Inetpub\Adminscript\cscript.exe adsutil.vbs Set W3SVC&lt;/b&gt;&lt;a&gt;&lt;b&gt;&lt;font color="#000000"&gt;/&amp;lt;Website identifier&amp;gt;/CertCheckMode&lt;/font&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt; 1&lt;/b&gt;&amp;nbsp; 
&lt;/p&gt;&lt;p&gt;I had seen an interesting case where 2 of the websites were accepting the same client cert whereas another one was not accepting it on the same web server. 
&lt;/p&gt;&lt;p&gt;Checking the metabase.xml for the server showed this: 
&lt;/p&gt;&lt;p&gt;Non-Working site: 
&lt;/p&gt;&lt;p&gt;================= 
&lt;/p&gt;&lt;p&gt;&amp;lt;IIsWebServer Location ="/LM/W3SVC/690402" 
&lt;/p&gt;&lt;p&gt;AuthFlags="0" 
&lt;/p&gt;&lt;p&gt;LogPluginClsid="{FF160663-DE82-11CF-BC0A-00AA006111E0}" 
&lt;/p&gt;&lt;p&gt;SSLCertHash="8bcfc28e346bb9ec49374d87479021354349cf85" 
&lt;/p&gt;&lt;p&gt;SSLStoreName="MY" 
&lt;/p&gt;&lt;p&gt;SecureBindings="XX.XX.XX.X:443:" 
&lt;/p&gt;&lt;p&gt;ServerAutoStart="TRUE" 
&lt;/p&gt;&lt;p&gt;ServerBindings="XX.XX.XX.X:80:" 
&lt;/p&gt;&lt;p&gt;ServerComment="CDB" 
&lt;/p&gt;&lt;p&gt;&amp;gt; 
&lt;/p&gt;&lt;p&gt;&amp;lt;/IIsWebServer&amp;gt; 
&lt;/p&gt;&lt;p&gt;Working Site: 
&lt;/p&gt;&lt;p&gt;============= 
&lt;/p&gt;&lt;p&gt;&amp;lt;IIsWebServer Location ="/LM/W3SVC/90326589" 
&lt;/p&gt;&lt;p&gt;AuthFlags="0" 
&lt;/p&gt;&lt;p&gt;&lt;b&gt;CertCheckMode="1"&lt;/b&gt; 
&lt;/p&gt;&lt;p&gt;LogPluginClsid="{FF160663-DE82-11CF-BC0A-00AA006111E0}" 
&lt;/p&gt;&lt;p&gt;SSLCertHash="a640634e38ff20ebd8c29c32aae635e5575e57f6" 
&lt;/p&gt;&lt;p&gt;SSLStoreName="MY" 
&lt;/p&gt;&lt;p&gt;SecureBindings="XX.XX.XX.Y:443:"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/p&gt;&lt;p&gt;ServerAutoStart="TRUE" 
&lt;/p&gt;&lt;p&gt;ServerBindings="XX.XX.XX.Y:80:wcdb" 
&lt;/p&gt;&lt;p&gt;ServerComment="WCDB" 
&lt;/p&gt;&lt;p&gt;&amp;gt; 
&lt;/p&gt;&lt;p&gt;&amp;lt;/IIsWebServer&amp;gt; 
&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Look at the difference between them. You see CertCheckMode is absent in the Non-working site, and absence of this key is equivalent to it being enabled. So once we put the CertCheckMode set to "1" for non-working site we should be able to resolve the issue. But this means that CRL chekcing is disabled. You may downlaod the CRL on to the server or else open up the relevant ports in order to allow CRL to be retrieved. 
&lt;/p&gt;&lt;p&gt;Check the KB 294305. 
&lt;/p&gt;&lt;p&gt;You may also check KB 841632 if IIS 5.0 is in picture. 
&lt;/p&gt;&lt;p&gt;There was an interesting case, where users were getting 403.13 even when client cert was not revoked and&amp;nbsp;we were able to access the get the CRL from the CDP for the client cert by accessing it through&amp;nbsp;a browser. Yet after a lot of tracing and monitoring we found that there was a 4-level hierarchy in the certificate chain, with let's say Root CA1 -&amp;gt;Subordinate Root CA2-&amp;gt;Subordinate Root CA3 -&amp;gt; Client certificate and one of the subordinate root CA's crl was not accessible. There are tools like certutil or SSLspy that can come handy. We ran certutil.exe -verify -urlfetch &amp;lt;location of the client cert.cer&amp;gt; on the IIS server and found that&amp;nbsp;CRL retrieval for&amp;nbsp;Subordinate&amp;nbsp;Root CA2 was failing, and hence the issue. 
&lt;/p&gt;&lt;p&gt;&lt;b&gt;So remember that we need to make sure that the CDPs for all the subordinate CAs certifcates in the chain should also be reachable.&lt;/b&gt; 
&lt;/p&gt;&lt;p&gt;Let's say for&amp;nbsp;my client certificate, the Certification path shows: 
&lt;/p&gt;&lt;p&gt;&lt;b&gt;Microsoft Corporate Root CA&lt;/b&gt; 
&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;|--&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Microsoft Corp Enterprise CA 2&lt;/b&gt; 
&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|--&amp;gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Saurabh Singh&lt;/b&gt; 
&lt;/p&gt;&lt;p&gt;Here&amp;nbsp;is the information for certificate "&lt;i&gt;&lt;b&gt;Saurabh singh&lt;/b&gt;&lt;/i&gt;" 
&lt;/p&gt;&lt;p&gt;CRL Distribution Points (Under Details-&amp;gt;Field)&amp;nbsp;shows: 
&lt;/p&gt;&lt;p&gt;[1]CRL Distribution Point&lt;br&gt;Distribution Point Name:&lt;br&gt;Full Name:&lt;br&gt;URL=ldap:///CN=Microsoft%20Corp%20Enterprise%20CA%202(4),CN=CRL,CN=CDP,CN=Public%20Key%20Services,CN=Services,CN=Configuration,DC=corp,DC=microsoft,DC=com?certificateRevocationList?base?objectClass=cRLDistributionPoint&lt;br&gt;URL=&lt;a href="http://corppki/crl/Microsoft%20Corp%20Enterprise%20CA%202%284%29.crl" mce_href="http://corppki/crl/Microsoft%20Corp%20Enterprise%20CA%202(4).crl"&gt;http://corppki/crl/Microsoft%20Corp%20Enterprise%20CA%202(4).crl&lt;/a&gt;&lt;br&gt;URL=&lt;a href="http://crl.microsoft.com/pki/mscorp/crl/Microsoft%20Corp%20Enterprise%20CA%202%284%29.crl" mce_href="http://crl.microsoft.com/pki/mscorp/crl/Microsoft%20Corp%20Enterprise%20CA%202(4).crl"&gt;http://crl.microsoft.com/pki/mscorp/crl/Microsoft%20Corp%20Enterprise%20CA%202(4).crl&lt;/a&gt; 
&lt;/p&gt;&lt;p&gt;Authority Information Access shows: 
&lt;/p&gt;&lt;p&gt;[1]Authority Info Access&lt;br&gt;Access Method=Certification Authority Issuer (1.3.6.1.5.5.7.48.2)&lt;br&gt;Alternative Name:&lt;br&gt;URL=&lt;a href="http://corppki/aia/Microsoft%20Corp%20Enterprise%20CA%202%284%29.crt" mce_href="http://corppki/aia/Microsoft%20Corp%20Enterprise%20CA%202(4).crt"&gt;http://corppki/aia/Microsoft%20Corp%20Enterprise%20CA%202(4).crt&lt;/a&gt;&lt;br&gt;[2]Authority Info Access&lt;br&gt;Access Method=Certification Authority Issuer (1.3.6.1.5.5.7.48.2)&lt;br&gt;Alternative Name:&lt;br&gt;URL=&lt;a href="http://www.microsoft.com/pki/mscorp/Microsoft%20Corp%20Enterprise%20CA%202%284%29.crt" mce_href="http://www.microsoft.com/pki/mscorp/Microsoft%20Corp%20Enterprise%20CA%202(4).crt"&gt;http://www.microsoft.com/pki/mscorp/Microsoft%20Corp%20Enterprise%20CA%202(4).crt&lt;/a&gt; 
&lt;/p&gt;&lt;p&gt;Here&amp;nbsp;is the information for certificate&amp;nbsp; "&lt;i&gt;&lt;b&gt;Microsoft Corp Enterprise CA 2&lt;/b&gt;&lt;/i&gt;": 
&lt;/p&gt;&lt;p&gt;CRL Distribution Points (Under Details-&amp;gt;Field)&amp;nbsp;shows: 
&lt;/p&gt;&lt;p&gt;[1]CRL Distribution Point&lt;br&gt;Distribution Point Name:&lt;br&gt;Full Name:&lt;br&gt;URL=&lt;a href="http://corppki/crl/mscrca.crl" mce_href="http://corppki/crl/mscrca.crl"&gt;http://corppki/crl/mscrca.crl&lt;/a&gt;&lt;br&gt;URL=&lt;a href="http://crl.microsoft.com/pki/mscorp/crl/mscrca.crl" mce_href="http://crl.microsoft.com/pki/mscorp/crl/mscrca.crl"&gt;http://crl.microsoft.com/pki/mscorp/crl/mscrca.crl&lt;/a&gt; 
&lt;/p&gt;&lt;p&gt;Authority Information Access shows: 
&lt;/p&gt;&lt;p&gt;[1]Authority Info Access&lt;br&gt;Access Method=Certification Authority Issuer (1.3.6.1.5.5.7.48.2)&lt;br&gt;Alternative Name:&lt;br&gt;URL=&lt;a href="http://corppki/aia/mscrca.crt" mce_href="http://corppki/aia/mscrca.crt"&gt;http://corppki/aia/mscrca.crt&lt;/a&gt;&lt;br&gt;[2]Authority Info Access&lt;br&gt;Access Method=Certification Authority Issuer (1.3.6.1.5.5.7.48.2)&lt;br&gt;Alternative Name:&lt;br&gt;URL=&lt;a href="http://www.microsoft.com/pki/mscorp/mscrca.crt" mce_href="http://www.microsoft.com/pki/mscorp/mscrca.crt"&gt;http://www.microsoft.com/pki/mscorp/mscrca.crt&lt;/a&gt; 
&lt;/p&gt;&lt;p&gt;Now runnning the Certutil.exe as shown below: 
&lt;/p&gt;&lt;p&gt;cmd prompt&amp;gt; certutil.exe -verify -urlfetch &lt;b&gt;cert.cer&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;-------the client certificate 
&lt;/p&gt;&lt;p&gt;Here is the output: 
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;Issuer:&lt;br&gt;CN=Microsoft Corp Enterprise CA 2&lt;br&gt;Subject:&lt;br&gt;CN=Saurabh Singh&lt;br&gt;Cert Serial Number: 258a555c0004008b1c42 &lt;/font&gt;
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;dwFlags = CA_VERIFY_FLAGS_DUMP_CHAIN (0x40000000)&lt;br&gt;ChainFlags = CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT (0x40000000)&lt;br&gt;HCCE_LOCAL_MACHINE&lt;br&gt;CERT_CHAIN_POLICY_BASE&lt;br&gt;-------- CERT_CHAIN_CONTEXT --------&lt;br&gt;ChainContext.dwInfoStatus = CERT_TRUST_HAS_PREFERRED_ISSUER (0x100)&lt;br&gt;ChainContext.dwRevocationFreshnessTime: 176 Days, 6 Hours, 5 Minutes, 17 Seconds &lt;/font&gt;
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;SimpleChain.dwInfoStatus = CERT_TRUST_HAS_PREFERRED_ISSUER (0x100)&lt;br&gt;SimpleChain.dwRevocationFreshnessTime: 176 Days, 6 Hours, 5 Minutes, 17 Seconds &lt;/font&gt;
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;CertContext[0][0]: dwInfoStatus=102 dwErrorStatus=0&lt;br&gt;Issuer: CN=Microsoft Corp Enterprise CA 2&lt;br&gt;Subject: CN=Saurabh Singh&lt;br&gt;Serial: 258a555c0004008b1c42&lt;br&gt;Template: AutoEnrolled Client Auth&lt;br&gt;48 b7 48 da 00 51 21 77 b3 e1 3a ce 98 7d 35 2f b7 e8 0c 1c&lt;br&gt;Element.dwInfoStatus = CERT_TRUST_HAS_KEY_MATCH_ISSUER (0x2)&lt;br&gt;Element.dwInfoStatus = CERT_TRUST_HAS_PREFERRED_ISSUER (0x100)&lt;br&gt;---------------- Certificate AIA ----------------&lt;br&gt;Verified "Certificate (0)" Time: 1&lt;br&gt;[0.0] &lt;/font&gt;&lt;a href="http://corppki/aia/Microsoft%20Corp%20Enterprise%20CA%202%284%29.crt" mce_href="http://corppki/aia/Microsoft%20Corp%20Enterprise%20CA%202(4).crt"&gt;&lt;font color="#8000ff"&gt;http://corppki/aia/Microsoft%20Corp%20Enterprise%20CA%202(4).crt&lt;/font&gt;&lt;/a&gt; 
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;Verified "Certificate (0)" Time: 1&lt;br&gt;[1.0] &lt;/font&gt;&lt;a href="http://www.microsoft.com/pki/mscorp/Microsoft%20Corp%20Enterprise%20CA%202%284%29.crt" mce_href="http://www.microsoft.com/pki/mscorp/Microsoft%20Corp%20Enterprise%20CA%202(4).crt"&gt;&lt;font color="#8000ff"&gt;http://www.microsoft.com/pki/mscorp/Microsoft%20Corp%20Enterprise%20CA%202(4).crt&lt;/font&gt;&lt;/a&gt; 
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;---------------- Certificate CDP ----------------&lt;br&gt;Verified "Base CRL (821)" Time: 0&lt;br&gt;[0.0] ldap:///CN=Microsoft%20Corp%20Enterprise%20CA%202(4),CN=CRL,CN=CDP,CN=Public%20Key%20Services,CN=Services,CN=Configuration,DC=corp,DC=microsoft,DC=com?certificateRevocationList?base?objectClass=cRLDistributionPoint &lt;/font&gt;
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;Verified "Base CRL (821)" Time: 0&lt;br&gt;[1.0] &lt;/font&gt;&lt;a href="http://corppki/crl/Microsoft%20Corp%20Enterprise%20CA%202%284%29.crl" mce_href="http://corppki/crl/Microsoft%20Corp%20Enterprise%20CA%202(4).crl"&gt;&lt;font color="#8000ff"&gt;http://corppki/crl/Microsoft%20Corp%20Enterprise%20CA%202(4).crl&lt;/font&gt;&lt;/a&gt; 
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;Verified "Base CRL (821)" Time: 1&lt;br&gt;[2.0] &lt;/font&gt;&lt;a href="http://crl.microsoft.com/pki/mscorp/crl/Microsoft%20Corp%20Enterprise%20CA%202%284%29.crl" mce_href="http://crl.microsoft.com/pki/mscorp/crl/Microsoft%20Corp%20Enterprise%20CA%202(4).crl"&gt;&lt;font color="#8000ff"&gt;http://crl.microsoft.com/pki/mscorp/crl/Microsoft%20Corp%20Enterprise%20CA%202(4).crl&lt;/font&gt;&lt;/a&gt; 
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;---------------- Base CRL CDP ----------------&lt;br&gt;No URLs "None" Time: 0&lt;br&gt;--------------------------------&lt;br&gt;CRL 821:&lt;br&gt;Issuer: CN=Microsoft Corp Enterprise CA 2&lt;br&gt;fd 19 3c 2f 0c 24 ea 1c 4a 5d df c4 26 2a b0 1b 98 48 ef 99&lt;br&gt;Application[0] = 1.3.6.1.5.5.7.3.2 Client Authentication &lt;/font&gt;
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;CertContext[0][1]: dwInfoStatus=102 dwErrorStatus=0&lt;br&gt;Issuer: CN=Microsoft Corporate Root CA, O=Microsoft Corporation&lt;br&gt;Subject: CN=Microsoft Corp Enterprise CA 2&lt;br&gt;Serial: 610d1de0000000000019&lt;br&gt;Template: SubCA&lt;br&gt;17 0a 7b 9d 52 85 07 7e 74 1a f5 a0 6b db 05 78 9e bc f1 8d&lt;br&gt;Element.dwInfoStatus = CERT_TRUST_HAS_KEY_MATCH_ISSUER (0x2)&lt;br&gt;Element.dwInfoStatus = CERT_TRUST_HAS_PREFERRED_ISSUER (0x100)&lt;br&gt;---------------- Certificate AIA ----------------&lt;br&gt;No CRL "Certificate (0)" Time: 0&lt;br&gt;[0.0] &lt;/font&gt;&lt;a href="http://corppki/aia/mscrca.crt" mce_href="http://corppki/aia/mscrca.crt"&gt;&lt;font color="#8000ff"&gt;http://corppki/aia/mscrca.crt&lt;/font&gt;&lt;/a&gt; 
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;No CRL "Certificate (0)" Time: 1&lt;br&gt;[1.0] &lt;/font&gt;&lt;a href="http://www.microsoft.com/pki/mscorp/mscrca.crt" mce_href="http://www.microsoft.com/pki/mscorp/mscrca.crt"&gt;&lt;font color="#8000ff"&gt;http://www.microsoft.com/pki/mscorp/mscrca.crt&lt;/font&gt;&lt;/a&gt; 
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;---------------- Certificate CDP ----------------&lt;br&gt;Verified "Base CRL (18)" Time: 0&lt;br&gt;[0.0] &lt;/font&gt;&lt;a href="http://corppki/crl/mscrca.crl" mce_href="http://corppki/crl/mscrca.crl"&gt;&lt;font color="#8000ff"&gt;http://corppki/crl/mscrca.crl&lt;/font&gt;&lt;/a&gt; 
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;Verified "Base CRL (18)" Time: 0&lt;br&gt;[1.0] &lt;/font&gt;&lt;a href="http://crl.microsoft.com/pki/mscorp/crl/mscrca.crl" mce_href="http://crl.microsoft.com/pki/mscorp/crl/mscrca.crl"&gt;&lt;font color="#8000ff"&gt;http://crl.microsoft.com/pki/mscorp/crl/mscrca.crl&lt;/font&gt;&lt;/a&gt; 
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;---------------- Base CRL CDP ----------------&lt;br&gt;No URLs "None" Time: 0&lt;br&gt;--------------------------------&lt;br&gt;CRL 18:&lt;br&gt;Issuer: CN=Microsoft Corporate Root CA, O=Microsoft Corporation&lt;br&gt;0e 70 65 69 a7 4c f9 7d 9f 50 7b db 9c e1 b8 27 9e 53 ba f4 &lt;/font&gt;
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;CertContext[0][2]: dwInfoStatus=10c dwErrorStatus=0&lt;br&gt;Issuer: CN=Microsoft Corporate Root CA, O=Microsoft Corporation&lt;br&gt;Subject: CN=Microsoft Corporate Root CA, O=Microsoft Corporation&lt;br&gt;Serial: 443c2a54b59cd69d4c09b18a9b02eb55&lt;br&gt;d2 d3 8e ba 60 ca a1 c1 20 55 a2 e1 c8 3b 15 ad 45 01 10 c2&lt;br&gt;Element.dwInfoStatus = CERT_TRUST_HAS_NAME_MATCH_ISSUER (0x4)&lt;br&gt;Element.dwInfoStatus = CERT_TRUST_IS_SELF_SIGNED (0x8)&lt;br&gt;Element.dwInfoStatus = CERT_TRUST_HAS_PREFERRED_ISSUER (0x100)&lt;br&gt;---------------- Certificate AIA ----------------&lt;br&gt;No URLs "None" Time: 0&lt;br&gt;---------------- Certificate CDP ----------------&lt;br&gt;No URLs "None" Time: 0&lt;br&gt;-------------------------------- &lt;/font&gt;
&lt;/p&gt;&lt;p&gt;&lt;font color="#8000ff"&gt;Exclude leaf cert:&lt;br&gt;8a cf e9 23 e2 d7 cd d1 f0 bb 05 6e 63 b5 31 95 6e 46 0d ad&lt;br&gt;Full chain:&lt;br&gt;5b fa 04 32 34 21 49 11 92 56 b3 ee 41 94 b4 b8 f3 f6 44 f2&lt;br&gt;------------------------------------&lt;br&gt;Verified Issuance Policies: None&lt;br&gt;Verified Application Policies:&lt;br&gt;1.3.6.1.5.5.7.3.2 Client Authentication&lt;br&gt;Leaf certificate revocation check passed&lt;br&gt;CertUtil: -verify command completed successfully.&lt;/font&gt; 
&lt;/p&gt;&lt;p&gt;If you notice the Certutil.exe tries to check the CRL accessibility by accessing the CRL Distribution points.&amp;nbsp;The above command ouptput should give you an idea regarding the cause. You&amp;nbsp;may see an error in accessing the CRL in the output above in cases where you get the above errors. 
&lt;/p&gt;&lt;p&gt;Here is something similar when you get an error: 
&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;----------------&amp;nbsp; Certificate CDP&amp;nbsp; ----------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp; Failed "CDP" Time: 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error retrieving URL: The specified network resource or device is no longer available. 0x80070037 (WIN32: 55)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldap:///CN=CRL1, CN=xxxx, OU=xxxx, OU=xxxx. by ref. (limits liab.), O=xxxx, C=US?certificateRevocationList;binary,authorityRevocationList;binary,deltaRevocationList;binary&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp; Failed "CDP" Time: 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error retrieving URL: The server name or address could not be resolved 0x80072ee7 (WIN32: 12007)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://www.some_company.net/CRL/net1.crl"&gt;&lt;font color="#0000ff"&gt;http://www.some_company.net/CRL/net1.crl&lt;/font&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp; --------------------------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp; Application[0] = 1.3.6.1.5.5.7.3.4 Secure Email&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp; Application[1] = 1.3.6.1.5.5.7.3.1 Server Authentication&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp; Application[2] = 1.3.6.1.5.5.7.3.2 Client Authentication&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp; Application[3] = 1.3.6.1.5.5.7.3.3 Code Signing&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;Exclude leaf cert:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp; 14 4c 46 42 11 66 a4 a9 42 70 ad b6 e0 1e 23 ca d4 9b 24 0e&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;Full chain:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp; fe 37 4a cf 76 3e 01 14 21 a6 c7 25 35 14 97 e5 91 87 e3 b7&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp; Issuer: CN=A company, OU=&lt;st1:place w:st="on"&gt;&lt;st1:City w:st="on"&gt;PKI&lt;/st1:City&gt;, &lt;st1:State w:st="on"&gt;DC&lt;/st1:State&gt;&lt;/st1:place&gt;=company, DC=com&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp; Subject: OID.0.9.2342.19200300.100.1.1=ZALDI001, OU=People, OU=SAP, DC=company, DC=com&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp; Serial: 42c550de&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp; 6e 33 5f 13 e1 67 ad 41 71 02 96 17 c7 57 c9 91 ea cb 1d 24&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;The revocation function was unable to check revocation because the revocation server was offline. 0x80092013 (-2146885613)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;------------------------------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;Revocation check skipped -- server offline&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;Cert is an End Entity certificate&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;ERROR: Verifying leaf certificate revocation status returned The revocation function was unable to check revocation because the revocation server was offline. 0x80092013 (-2146885613)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;CertUtil: The revocation function was unable to check revocation because the revocation server was offline.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Ensure that &lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;the necessary firewall/network configuration changes to allow the IIS server to access ALL of the external CDP’s listed in the client cert’s revocation chain, or&amp;nbsp;d&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;ownload the CRL(s) to the IIS server manually and set CertCheckMode to MD_CERT_CACHE_RETRIEVAL_ONLY (see this link &lt;a href="http://technet2.microsoft.com/windowsserver/en/library/173427fd-eb90-44ef-8a9c-d7bb4ff41ab81033.mspx?mfr=true"&gt;http://technet2.microsoft.com/windowsserver/en/library/173427fd-eb90-44ef-8a9c-d7bb4ff41ab81033.mspx?mfr=true&lt;/a&gt; ).&amp;nbsp; That will tell IIS to look at the CRL in its local store and not try to attempt to access the CRL via the CDP entries specified in the client cert.&amp;nbsp; &lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p&gt;One more confusing point that should be clarified here: 
&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;If you have a certificate chain, let's say: Root CA -&amp;gt; Intermediate CA1 -&amp;gt; Intermediate CA2 -&amp;gt;..... -&amp;gt;&amp;lt;Your Client ceritficate&amp;gt;, then CRL checking will be done for all the Certificates in the hierarchy&amp;nbsp;except the Root CA.&lt;/b&gt;&lt;/i&gt; 
&lt;/p&gt;&lt;p&gt;If you are really interested to dig further as to how Certificate Revocation etc. works at a lower level, here is a real exhaustive link to check it out.&amp;nbsp; 
&lt;/p&gt;&lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/library/af1e419e-ede5-8c4b-bf6e-1fb17658a99d.aspx" title="http://technet.microsoft.com/en-us/library/af1e419e-ede5-8c4b-bf6e-1fb17658a99d.aspx" mce_href="http://technet.microsoft.com/en-us/library/af1e419e-ede5-8c4b-bf6e-1fb17658a99d.aspx"&gt;http://technet.microsoft.com/en-us/library/af1e419e-ede5-8c4b-bf6e-1fb17658a99d.aspx&lt;/a&gt; 
&lt;/p&gt;&lt;h3&gt;&lt;b&gt;&lt;u&gt;Another issue that pops up from time to time is:&amp;nbsp;&lt;/u&gt;&lt;/b&gt; &lt;/h3&gt;
&lt;p&gt;&lt;i&gt;&lt;b&gt;&lt;/b&gt;&lt;/i&gt;
&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;"Choose a digital certificate"&lt;/b&gt;&lt;/i&gt; popup window in Internet Explorer is blank when attempting to use client certificates to authenticate against IIS. 
&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;This can happen in situations as explained earlier too in cases where: &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;The total size of the certificates in the Trusted Root Certification Authorities store on the IIS server was too large to send to the client. The list was truncated as a result. &lt;/p&gt;
&lt;p&gt;The following event was written to the System log:&lt;br&gt;&lt;font color="#ff0000"&gt;Event Type: Warning &lt;br&gt;Event Source: Schannel &lt;br&gt;Event ID: 36885 &lt;br&gt;Description: When asking for client authentication, this server sends a list of trusted certificate authorities to the client. The client uses this list to choose a client certificate that is trusted by the server. Currently, this server trusts so many certificate authorities that the list has grown too long. This list has thus been truncated. The administrator of this machine should review the certificate authorities trusted for client authentication and remove those that do not really need to be trusted.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000"&gt;Resolution would be to Remove unused certificates from the Trusted Root Certification Authorities store on the IIS server, reducing the number of certificates.&amp;nbsp;&lt;/font&gt; 
&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;Also another cause may be when the any of the Subordinate CAs-&amp;gt;certificate-&amp;gt;Details-&amp;gt;Edit Properties button has Client Authentication disabled in the intended purposes. &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Also this should be of help at times &lt;a href="http://support.microsoft.com/kb/285069/" title="http://support.microsoft.com/kb/285069/" mce_href="http://support.microsoft.com/kb/285069/"&gt;http://support.microsoft.com/kb/285069/&lt;/a&gt;&amp;nbsp; 
&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;Also if we have certificate trust list(CTL) enabled,&amp;nbsp;CTL that IIS sends&amp;nbsp;is what the client uses to know if it has a client cert it can use. 
&lt;/li&gt;&lt;li&gt;Also&amp;nbsp;there is a &amp;lt;12kb&amp;gt; limit on this and if the customer has applied the Trusted Root CA update, then we may not send the full list of trusted CA’s. Make sure that CA is in CTL as well as the size limit. You may want to revisit the article
&lt;a href="http://support.microsoft.com/kb/933430" title="KB" target="_blank" mce_href="http://support.microsoft.com/kb/933430"&gt;http://support.microsoft.com/kb/933430&lt;/a&gt;. Either install the hotfix if it
is applicable or try deleting/moving to other store some of the unused/junk CAs from
the Trusted Root Certificate Authority Store on the IIS server. That
could do the trick for you!&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Refer to one of our finest Escalation engineer&amp;nbsp;(Andreas&amp;nbsp;Klein)'s&amp;nbsp;blog which talks about limiting the list of CA's allowed for Client authentication, without&amp;nbsp;deleting the CAs from the store. 
&lt;/p&gt;&lt;p&gt;&lt;a href="http://blogs.msdn.com/andrekl/archive/2005/04/19/409682.aspx" title="http://blogs.msdn.com/andrekl/archive/2005/04/19/409682.aspx" mce_href="http://blogs.msdn.com/andrekl/archive/2005/04/19/409682.aspx"&gt;http://blogs.msdn.com/andrekl/archive/2005/04/19/409682.aspx&lt;/a&gt; 
&lt;/p&gt;&lt;p&gt;Also while&amp;nbsp;you may&amp;nbsp;have the certificate in your personal store (using the mmc snap-in it shows up properly), you may not see it in the IE browser. If&amp;nbsp;you go through &lt;b&gt;Internet Options-&amp;gt;Content &lt;/b&gt;and click Certificates, it doesn’t show up at all. Open&amp;nbsp;the certificate MMC and check whether the cert has a Private key or not. 
&lt;/p&gt;&lt;p&gt;If the General tab on the cert properties does not say at the bottom that you have a Private Key corresponding to this cert then you don’t, and this may lead to the above problem.&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;403.16 - Client certificate is untrusted or invalid. &lt;/b&gt;
&lt;/p&gt;&lt;p&gt;This error message is primarily generated when the certificate that the client provided is improperly formed. It can also be generated if there are intermediate certification authorities in the certificate chain that are not trusted by the Web server. 
&lt;/p&gt;&lt;p&gt;&lt;b&gt;403.17 - Client certificate has expired or is not yet valid &lt;/b&gt;
&lt;/p&gt;&lt;p&gt;This error message is fairly self-explanatory. It means that the current date on the server is not within the valid date ranges that are presented in the client certificate. You may also want to ensure that the client certificate and its issuing CAs (including Intermediate CAs) are not expired or invalid.&lt;br&gt; &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3185914" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Client+Certificate/default.aspx">Client Certificate</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Authentication/default.aspx">Authentication</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/SSL/default.aspx">SSL</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category></item><item><title>How to setup IIS and AD for Client certificate authentication</title><link>http://blogs.msdn.com/saurabh_singh/archive/2007/04/14/how-to-setup-iis-and-ad-for-client-certificate-setup-and-authentication.aspx</link><pubDate>Sat, 14 Apr 2007 14:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2130289</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>15</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/2130289.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=2130289</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=2130289</wfw:comment><description>&lt;p&gt;Hi All,  &lt;p&gt;This post talks about how Client certificates are configured on websites. I have seen a lot of incidents where people get into issues with client certificate in particular, although server (website) certificates can give a scare at times.  &lt;p&gt;Here I will be walking you through the steps of configuring client certificates in your Windows 2003 environment (although there is not much of a difference in Windows 2000).  &lt;p&gt;&lt;b&gt;&lt;u&gt;Environment&lt;/u&gt;&lt;/b&gt;  &lt;p&gt;Windows 2003 (Web server) IIS6.0  &lt;p&gt;Windows 2000/XP/2003 (Client)  &lt;p&gt;Windows 2003 (Microsoft Certificate server)  &lt;p&gt;&lt;b&gt;&lt;u&gt;Walkthrough&lt;/u&gt;&lt;/b&gt;  &lt;p&gt;1. To enable SSL transaction between the server and the client, you need to have a server certificate installed on IIS website. Websites can get the server certificate from a trusted root Certificate Authority (CA). We will be focusing on the steps for acquiring client certificates and setting them in IIS for user authentication.  &lt;p&gt;2. Here I will show the screenshot of the steps that one needs to follow with brief explanation of the steps.  &lt;p&gt;Client Workstation:&lt;b&gt; WIN2kIIS-VPC&lt;/b&gt;  &lt;p&gt;CA server:&lt;b&gt; WIN2K3DC&lt;/b&gt;  &lt;p&gt;IIA Web Server:&lt;b&gt; WIN2K3OWA&lt;/b&gt;  &lt;p&gt;DC:&lt;b&gt; WIN2K3DC&lt;/b&gt;  &lt;p&gt;Domain:&lt;b&gt; Anjenya.local&lt;/b&gt;  &lt;p&gt;&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt; &lt;p&gt;&lt;b&gt;&lt;i&gt;Requesting a client certificate from a Trusted root Certificate Authority (CA): &lt;/i&gt;&lt;/b&gt; &lt;p&gt;Access the CA Website from your client machine as &lt;a href="http://win2k3dc/certsrv" mce_href="http://Win2k3dc/certsrv"&gt;http://Win2k3dc/certsrv&lt;/a&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="438" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;There are two ways of obtaining client certificate.&lt;/p&gt; &lt;p&gt;Click on the link: Request a Certificate.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="438" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_1.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Click on “Select a certificate type: User certificate”.  &lt;p&gt;You can also obtain the certificate by clicking on “advanced certificate request” to add more specific details about the client certificate.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_6.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="438" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_2.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Click on &lt;b&gt;&lt;i&gt;More Options &amp;gt;&amp;gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_8.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="438" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_3.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Go ahead and hit &lt;b&gt;&lt;i&gt;Submit &amp;gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_10.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="409" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_4.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Click on &lt;b&gt;&lt;i&gt;“Yes”&lt;/i&gt;&lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_12.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="438" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_5.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Go ahead and click on the link to install the certificate. You might get the certificate directly as above or through email etc when in case of a 3&lt;sup&gt;rd&lt;/sup&gt; party after verification.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_14.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="400" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_6.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Click on &lt;b&gt;&lt;i&gt;“Yes”&lt;/i&gt;&lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_16.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="436" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_7.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Now the User certificate is successfully installed on your client machine.&lt;/p&gt; &lt;p&gt;You can check the certificate in two ways:  &lt;p&gt;1. Goto &lt;b&gt;&lt;i&gt;IE-&amp;gt;Tools-&amp;gt;Internet Options-&amp;gt;Content-&amp;gt;Certificates&lt;/i&gt;&lt;/b&gt;.  &lt;p&gt;You should see the certificate there under Personal store, which was installed on your client machine.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_18.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="437" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_8.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;1. Or else you can open the Certificate snap-in through &lt;b&gt;&lt;i&gt;Start-&amp;gt;Run-&amp;gt;Mmc-&amp;gt;Console-&amp;gt;Add/Remove Snap-in-&amp;gt;Add… -&amp;gt; Certificates&lt;/i&gt;&lt;/b&gt;.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_20.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="452" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_9.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Go ahead and add the certificates snap-in.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_22.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="452" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_10.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Double click on the certificate and you should see the details about it:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_24.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="487" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_11.png" width="419" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Enhanced Key usage will show you the purpose of this certificate.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_26.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="487" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_12.png" width="419" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The above picture shows that this certificate is meant for Client Authentication.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_28.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="487" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_13.png" width="419" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;So here we finish the process of acquiring the client certificate.&lt;/p&gt; &lt;p&gt;Now the next step is to map the client certificate in IIS manager, depending upon one’s requirements. It can be one of the following:  &lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Option to accept the client certificate from the user by the IIS website (with no mapping enabled).  &lt;li&gt;Option to have 1-to-1 mapping for client certificate.  &lt;li&gt;Option to have Many-to-one mapping for client certificate.  &lt;li&gt;Option to have Active Directory Mapping for client certificate.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;1-to-1 and Many-to-1 mapping are simple to setup.  &lt;p&gt;Here I will walk you through the process of setting up the above configuration for 1-to-1 mapping and Active directory mapping.  &lt;p&gt;Let’s say that you have a website in IIS for which you want to enable client certificate.  &lt;p&gt;You need to go to &lt;b&gt;&lt;i&gt;IIS Manager-&amp;gt;Default Website-&amp;gt; &lt;/i&gt;&lt;/b&gt;&lt;i&gt;right click and go to&lt;b&gt; Properties-&amp;gt;Directory Security-&amp;gt;&lt;/b&gt;Under&lt;b&gt; Secure Communications &lt;/b&gt;section&lt;b&gt;, click on Edit&lt;/b&gt;&lt;/i&gt;.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_30.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="432" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_14.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_32.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="469" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_15.png" width="479" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Here in the picture above, you have three options for Client Certificates:  &lt;ul&gt; &lt;li&gt;Ignore client certificates: IIS will ignore client certificate when a request reaches IIS website, even though web request has the certificate in it.  &lt;li&gt;Accept Client certificates: IIS website will accept any client certificate from the user, if it is along with the web request.  &lt;li&gt;Require Client certificates: IIS website will check for client certificate along with web request. If no client certificate is in the web request, users shall see 403.7 – Client certificate required, as the error message in the web page response.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Now in the next section in the same picture above, if you want your website to be configured such that a client certificate is mapped to a user account, you can check on “Enable client certificate mapping”. What it means is that request will be executed in the context of an account.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_34.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="523" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_16.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Now, when you enable 1-to -1 Mapping, an individual client certificate will be mapped to a specific Windows account. So in case you don’t want any of the IIS authentication methods to be used, like Anonymous, Basic, Digest or Windows Integrated authentication, you can rely upon client certificate authentication based on 1-to -1 or Many-to-1 mappings.  &lt;p&gt;We will first go ahead with 1-to-1 mapping:  &lt;p&gt;Click on “&lt;b&gt;Add…&lt;/b&gt;” in the Account Mappings window shown above.  &lt;p&gt;Now before you map a client certificate with a windows account, you need to have the corresponding client certificate on the server.  &lt;p&gt;Export the client certificate from the CA or the client machine (where you have the certificate installed) as follows:  &lt;p&gt;&lt;b&gt;&lt;u&gt;1) From Client machine&lt;/u&gt;&lt;/b&gt;: Open Certificate snap-in as earlier and go to &lt;b&gt;&lt;i&gt;Certificates – Current User &lt;/i&gt;-&amp;gt; &lt;i&gt;Personal -&amp;gt; Certificates&lt;/i&gt;&lt;/b&gt;.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_36.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="528" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_17.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Double click on the selected certificate and Click on &lt;b&gt;&lt;i&gt;Details&lt;/i&gt;&lt;/b&gt; and go to “&lt;b&gt;&lt;i&gt;Copy to File…&lt;/i&gt;&lt;/b&gt;”.  &lt;p&gt;Follow the Export wizard.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_38.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="607" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_18.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_40.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="607" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_19.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;You can either Export the private key or not export it. You should know the meaning of exporting the private key.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_42.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="607" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_20.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Go ahead and save the client certificate somewhere on your workstation (client).  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_44.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_21.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&lt;b&gt;2) &lt;/b&gt;&lt;b&gt;&lt;u&gt;From CA:&lt;/u&gt;&lt;/b&gt;  &lt;p&gt;Go to the Certificate Authority Snap-in and check the following location:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_46.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="338" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_22.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_48.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="485" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_23.png" width="418" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Double click to display the certificate. Click on “&lt;b&gt;Copy to File...&lt;/b&gt;” and follow the Certificate Export Wizard, and save the file to the server as shown below:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_50.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="403" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_24.png" width="515" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Now copy the saved certificate from any of the above location to the IIS server, where we need to map it a windows account.  &lt;p&gt;Back to IIS manager console for certificate mapping:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_52.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="443" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_25.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Now map a specific windows account with this certificate as shown below:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_54.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="422" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_26.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_56.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="464" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_27.png" width="645" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Once the 1 to 1 mapping is set in place go ahead and try browsing the site.  &lt;p&gt;Here I have used an ASP script to render the server variables pertaining to the web request.  &lt;p&gt;This script will display the logged on user name and the authentication type used along with some other information.  &lt;p&gt;Also when you want to use Client certificate authentication you can clear all other authentication options in the IIS manager Directory Security setting as show below:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_58.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="464" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_28.png" width="645" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Here you won’t get 401.2 server configuration error because we are using some sort of authentication mechanism (client certificate mapping) to authenticate the user. Had we been not using client certificate mapping we would have got 401.2 if we try to access the site with no authentication method selected in IIS manager.  &lt;p&gt;Had there not been Client cert mapping and we had tried to browse to the web page with all the options cleared as shown above, you would have got error 401.2.  &lt;p&gt;Here is the sample logoninfo.asp page which displays server variables. Try accessing this page.  &lt;p&gt;&amp;lt;%  &lt;p&gt;response.write ("LOGON_USER: ")  &lt;p&gt;response.write (request.servervariables("LOGON_USER"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("AUTH_USER: ")  &lt;p&gt;response.write (request.servervariables("AUTH_USER"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("AUTH_TYPE: ")  &lt;p&gt;response.write (request.servervariables("AUTH_TYPE"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("CERT_COOKIE: ")  &lt;p&gt;response.write (request.servervariables("CERT_COOKIE"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("CERT_ISSUER: ")  &lt;p&gt;response.write (request.servervariables("CERT_ISSUER"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("CERT_KEYSIZE: ")  &lt;p&gt;response.write (request.servervariables("CERT_KEYSIZE"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("CERT_SERIALNUMBER: ")  &lt;p&gt;response.write (request.servervariables("CERT_SERIALNUMBER"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("CERT_SERVER_ISSUER: ")  &lt;p&gt;response.write (request.servervariables("CERT_SERVER_ISSUER"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("CERT_SERVER_SUBJECT: ")  &lt;p&gt;response.write (request.servervariables("CERT_SERVER_SUBJECT"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("CERT_SUBJECT: ")  &lt;p&gt;response.write (request.servervariables("CERT_SUBJECT"))  &lt;p&gt;%&amp;gt;  &lt;p&gt;Now in our example we try accessing the above script and we get the following response:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_60.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="384" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_29.png" width="720" border="0"&gt;&lt;/a&gt;  &lt;p&gt;In the above step, if you disable Client cert and enable windows integrated authentication only, you should see something similar to the one shown below:  &lt;p&gt;Check the Authentication type.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_62.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="384" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_30.png" width="720" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Similarly you can try Many-to-1 mapping, please read MSDN/KB articles that talk about how to set it up…it’s very similar to 1 to 1 mapping.  &lt;p&gt;I would like to discuss Active Directory Mapping in particular here:  &lt;p&gt;We need to have Client certificate enabled, we can remove 1-to-1 and many-to-1 mapping from IIS Manager since we need to enable AD mapping.  &lt;p&gt;In AD mapping we need to follow the following steps:  &lt;p&gt;Go to the IIS Manager, right click on root level &lt;b&gt;&lt;i&gt;WEBSITES-&amp;gt;Properties-&amp;gt;Directory Security&lt;/i&gt;&lt;/b&gt;.  &lt;p&gt;Select “Enable the windows directory service mapper”.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_64.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_31.png" width="668" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Now go to Active directory, open Active directory users and computers, go to Users, and then select the user for which you want to map the certificate.  &lt;p&gt;Right click on the user name, go to &lt;b&gt;&lt;i&gt;Name Mappings&lt;/i&gt;&lt;/b&gt;. Add the client certificate. Now we have a mapping for that certificate to a user account in the AD.  &lt;p&gt;Go to the client machine and logon with the user credentials , and then try accessing the site now, and now you should be able to access the page and you should see the Logon name in the webpage, here the logon name will correspond to the same user with which we have associated the client certificate in the AD.  &lt;p&gt;Now you should see something like this:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_66.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="478" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_32.png" width="668" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;Remember this:&lt;/u&gt;&lt;/b&gt;  &lt;p&gt;&lt;b&gt;&lt;i&gt;Here is an excerpt from a TechNet article:&lt;/i&gt;&lt;/b&gt;  &lt;p&gt;In Active Directory mapping, when the IIS server receives a certificate from the user, it passes it on to Active Directory, which maps it to a Windows 2000/2003 user account. The IIS server then logs this account on.  &lt;p&gt;Active directory mapping is most useful when the account mappings are the same on all IIS servers. Administration is simplified because the mapping is done in only one place.  &lt;p&gt;Mapping in Active Directory can happen in one of two ways. The administrator can explicitly map a certificate to a user's account. This certificate can come from any source--as long as the root CA for that certificate is trusted for client authentication.  &lt;p&gt;UPN mapping can also be used. A UPN is automatically put into a certificate issued by an enterprise CA. If a certificate is passed to Active Directory for mapping, it is first examined for UPN mapping. If UPN mapping is not possible, the mapping set by the administrator is used.  &lt;p&gt;UPNs are in the form of userid@domain. If the certificate contains a UPN, the domain is within the hierarchy of the directory, and the CA that issued the certificate is trusted to put UPNs in the certificate, then the user's account is retrieved from the directory and logged on. All these conditions must be true before the user's account is retrieved. If any of these conditions is false, the directory is searched for a mapping set by the administrator.  &lt;p&gt;In Active Directory mapping, when the IIS server receives a certificate from the user, it passes it on to Active Directory, which maps it to a Windows 2000 or Windows Server 2003 user account. The IIS server then logs on the account.  &lt;p&gt;You can create an Active Directory mapping in one of two ways. You can rely on UPN mapping, or, if UPN mapping is not possible, you can manually map a certificate to the account of a user.  &lt;p&gt;Use Active Directory mapping when the account mappings are identical on all IIS servers. Active Directory mapping is easier to maintain than IIS mapping because you only have to create the mapping in one location.  &lt;p&gt;&lt;b&gt;&lt;i&gt;NOTE:&lt;/i&gt;&lt;/b&gt; Let’s assume that the user account with which we are trying to access the site doesn’t have a UPN name in the AD (this might happen in the case where the logged on user is a local user and not a Domain user) then in that case the logon credentials for the request will be the mapped user account for the certificate in the AD. Else, if the client certificate’s “Issued to” is a domain user account, then logon credentials will use that Account and not the mapped account associated with certificate. Also it will not respect user’s logged on credentials or server authentication method in IIS manager.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2130289" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Client+Certificate/default.aspx">Client Certificate</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Setup/default.aspx">Setup</category></item></channel></rss>