Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browser is not prompting for a client certificate

Tags:

Background:

I am updating an internal application to a two-step authentication process. I want to add a client certificate authentication process (via a smart card) on top of a traditional username/password form. The application is written in C#, hosted on IIS7, and targeting Chrome and IE8.

Problem:

I am having issues with getting the application to prompt the user for a client certificate. I have been debugging the application with the help of Fiddler. When I have a test client certificate saved in Fiddler's user's directory (C:\Documents and Settings\USER\My Documents\Fiddler2), the application works as expected. I am prompted for a PIN number protecting the smart card, and, when entered correctly, takes me to the login form. When I close Fiddler, the application throws a 403 Forbidden error instead (since Fiddler is no longer running and pointing to its certificate). What I haven't been able to figure out is why the application won't prompt for a certificate normally.

Current Server Setup:

  • Self Signed Certificate was created
  • 443 Binding is pointing at Self Signed Certificate
  • Anonymous Authentication is Enabled
  • The Self Signed Certificate was added to both the Trusted Root CA and Intermediate CA (I read that another person had it in both rather than just the Trusted Root CA and that solved their issue, though neither set up has worked for us).
  • I cleared out the rest of the certificates in the Trusted Root CA that I didn't need (I read elsewhere that having too many certificates would cause SSL to choke).

I am out of ideas to try other than starting from scratch on another server. Does anyone know what the issue might be? This seems like it should be fairly straight forward and that I'm missing something minor. Any ideas are welcomed.

Update:

After spending more time with this issue today, I strongly believe it has to do with IIS7 not being configured correctly (I did not set up it originally). I think this because I enabled Failed Request Tracing, looked at the subsequent .xml files being generated, and saw that a 500 error was being thrown.

Chrome is throwing a "Access to the webpage was denied" message rather than a "403 - Forbidden: Access is denied". I don't know if this helps. I do know that when I do not make certificates required, the site will work as intended. Requiring a certificate is where it fails.

The Application Pool is set to .Net 4.0 | Classic | Network Service.

like image 245
LNendza Avatar asked Feb 21 '13 23:02

LNendza


People also ask

How do I get a client certificate for my browser?

In Chrome, go to Settings. On the Settings page, below Default browser, click Show advanced settings. Under HTTPS/SSL, click Manage certificates. In the Certificates window, on the Personal tab, you should see your Client Certificate.

How do I enable Client Certificates?

On the taskbar, click Start, and then click Control Panel. In Control Panel, click Programs and Features, and then click Turn Windows Features on or off. Expand Internet Information Services, then select Client Certificate Mapping Authentication, and then click OK.

How do I get a certificate popup in chrome?

In the address bar, right click on the red warning triangle and "Not secure" message and, from the resulting menu, select "Certificate" to show the certificate.

How do I automatically select a client certificate in chrome?

Right-click on Computer Policy > Computer Configuration > Administrative Templates and choose Add/Remove Templates… Done. No more annoying pop-ups!


2 Answers

Your problem is that the browser doesn't either get the request to provide client certificate or there is a security related option to block it from happening. IE offers certificate only if the web site is in correct zone (intranet or trusted sites). Please check this before everything.

If that doesn't help then see this answer for next step. The netsh documentation says:

clientcertnegotiation Optional. Specifies whether the negotiation of certificate is enabled or disabled. Default is disabled. 

Enable that and even the dumbest browser should notice that it is supposed to offer certificate for authentication. To diagnose your problem further you can use WireShark to see the negotiation in action.

like image 61
user918176 Avatar answered Oct 20 '22 12:10

user918176


Try openssl s_client -connect yourip:443 -prexit And see if the CA (your self signed cert) is send to the client in the Acceptable client certificate CA names.

you need to install openssl first if you don't have it

like image 31
Boklucius Avatar answered Oct 20 '22 13:10

Boklucius