Closed Bug 634697 Opened 13 years ago Closed 4 years ago

Remember user's client certificate selection across sessions

Categories

(Core :: Security: PSM, enhancement, P1)

x86
Windows 7
enhancement

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: t.petrzilka, Assigned: mbirghan)

References

(Blocks 1 open bug)

Details

(Whiteboard: [psm-assigned])

Attachments

(2 files, 3 obsolete files)

User-Agent:       Mozilla/5.0 (Windows NT 6.1; rv:2.0b11) Gecko/20100101 Firefox/4.0b11
Build Identifier: Mozilla/5.0 (Windows NT 6.1; rv:2.0b11) Gecko/20100101 Firefox/4.0b11

When page requires user certificate for https connection, the dialog for selecting right certificate comes every time after browser restart, although, option at the bottom of dialog to remember my choice was previously selected. (certificate is already successfully imported in browser)

Reproducible: Always

Steps to Reproduce:
0.Goto site configured for https connection requiring user certificate, select right certificate and mark checkbox to remember this choice in the dialog, continue.

1.Restart Firefox
2.Goto site configured for https connection requiring user certificate
Actual Results:  
The dialog for selecting certificate shows up again.


Expected Results:  
Firefox should connect to the site without any inquiries about selecting certificate.
Adg asked to have this bug assigned to them.
Assignee: nobody → amandeepgautam
I was not able to reproduce the bug on Firefox/4.0b11 as told. If you check the button corresponding to the "permanently store this exception" firefox successfully remembers->options->advanced->encryption->view certificates->servers.
Assignee: amandeepgautam → nobody
Tomas, can you try to reproduce this with the latest nightly Firefox 4.0b12pre?  Thanks.
I can confirm, that FF 4.0b12 (not nightly) is still behaving as described before.

Also when the dialog for choosing the certificate is canceled it won't come back after attempt for another connection to the server.

----
Firefox 4.0b12 
Mozilla/5.0 (Windows NT 6.1; rv:2.0b12) Gecko/20100101 Firefox/4.0b12
(In reply to comment #3)
> I was not able to reproduce the bug on Firefox/4.0b11 as told. If you check the
> button corresponding to the "permanently store this exception" firefox
> successfully remembers->options->advanced->encryption->view
> certificates->servers.

The certificate is client-side so the exception dialog in: options->advanced->encryption->view certificates->servers
is not useful cause there is no server URL to remember the exception for.

The dialog I described is IMHO shown at very rare circumstances as for professional use mostly.. But still used.. 

It's just a glitch with lower importance..
Severity: normal → minor
Adding Paul to the cc list of this bug. Paul, is there some interaction with Session Store that could be causing this bug?

Tomas, would it be possible for you to either link or attach a test case we can use to try to reproduce this bug?
(In reply to comment #7)
> Adding Paul to the cc list of this bug. Paul, is there some interaction with
> Session Store that could be causing this bug?

Session Restore doesn't do anything with certs, so highly unlikely.
I also have this problem with an Aladdin E-Token.
I had the same 'issue' as described above, but I recognized the flag "Options->Advanced->Encryption->Certificates - When a site asks for a certificate:" (or similar, using German version). I switched from "Ask everytime" to "Select one automatically".
However, I'm not sure what this means exactlly does - in my opinion this misses a third option like "Ask only if new" or something. Maybe "Ask everytime" just ignores already stored site-cert associations?

---
Firefox 7.0.1 (German)
Win 7 x64
I have been annoyed by this problem for years, mentioned in in talks, discussed it with Anne van K in the TAG, and general taken it as indicating a lack of interest at Mozilla in client-side certs.   (Chrome does not have this problem, and so is easier to use if you use client certs a lot.)  At least from the discussion here it seems to be recognized as  bug -- but has a status of "UNCONFIRMED" surprises me.  So maybe it difficult to reproduce.  If it is supposed to work, where is the site->cert mapping stored?
For what it's worth, I can reproduce the bug. You're right that client-side certificate-related features aren't a high priority right now, since the majority of our users don't use them. It's unfortunate, but limited engineering resources mean we can't address everything we might want to.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Sufficient support of client certificates is one of the reasons, I use FireFox.

(In reply to Tim Berners-Lee from comment #11)
> So maybe it difficult to reproduce.

To my experience reproduction of this issue requires not very typical configuration: it need user, having several the same time valid client certificates in a certification chain. That, as I know, is not typical.
In the rest cases auto-fit client certificate works rather well.

(In reply to David Keeler [:keeler] (use needinfo?) from comment #12)
> For what it's worth, I can reproduce the bug. You're right that client-side
> certificate-related features aren't a high priority right now, since the
> majority of our users don't use them. It's unfortunate, but limited
> engineering resources mean we can't address everything we might want to.

Orienting on popularity NOW you can miss future.
Support of client certificates is not widely spread (yet?), but very _important_ (!) feature.

This feature (client certificates) is lessly used, than it should, because of insufficient support in clients.
And is lessly supported because of rare use.

P.S. Not long ago I've generate a certificate set for localhost to reproduce this issue.
If Mozilla developers need, I can attach these certs to this bug and, if necessary, consult in configuration of Apache web server (although it seems to be trivial).
This bug could have a more straightforward summary.
Summary: ff doesn't remember choice of certificate for https connection from previous session although "remember choice was selected" → Remember user's client certificate selection across sessions
Ref. my reply to related Thunderbird bug 803975 comment #6

In the present context, does the behaviour happen even if the preference "Ask me every time" is not selected?

In any case there is still Tim Berners-Lee's question in comment #11:
> If it is supposed to work, where is the site->cert mapping stored?
Blocks: 803975

(In reply to Tomáš from comment #6)

(In reply to comment #3)
The dialog I described is IMHO shown at very rare circumstances as for
professional use mostly.. But still used..

No, it happens to everyone who uses certificates* to do their taxes online, access their bank account etc.

  • even with a single installed certificate, the dialog is shown each time
Assignee: nobody → mbirghan

Found this bugzilla-entry by googleing for a solution for my problem - I have two client-certificates - one already expired and one is valid.
By default the already expired certificate is selected (due to the lower serial-number?) which is annoying because no error-message is displayed if I try to connect to the server with this expired client-cert - just an empty page. Checked with the webdeveloper-tools - there is a message that is at least a hint for the error that just occured ("SSL_ERROR_EXPIRED_CERT_ALERT").
And yes - I checked the "remeber this decision" for the valid client-cert with the higher serial-number. But after a browser-restart the expired certificate is the default-selection again.
Yes - the workaround would be to remove the expired client-cert from Firefox' certificate-store. But a workaround does not eliminate a bug ;-)

If I can help with some testing from user's side (as I am "only" a webdeveloper and webserver-admin, not a Firefox-programmer) I will be happy to do so.

Status: NEW → ASSIGNED
Type: defect → enhancement
Priority: -- → P3
Pushed by shindli@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a538b0497336
Refactoring nsClientAuthRememberService to work as a service r=keeler
Backout by shindli@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4143bf08dfe6
Backed out changeset a538b0497336 for causing android build bustages in /builds/worker/workspace/build/src/security/manager/ssl/nsNSSComponent.cpp CLOSED TREE

Moritz - when you fix the build issues, let's land this in a new bug so that the original purpose of this bug doesn't get lost.

Comment on attachment 9126100 [details]
Bug 634697 - Refactoring nsClientAuthRememberService to work as a service

Revision D62585 was moved to bug 1618710. Setting attachment 9126100 [details] to obsolete.

Attachment #9126100 - Attachment is obsolete: true

Comment on attachment 9110916 [details]
Bug 634697 - Remember user's client certificate selection across sessions

Revision D54336 was moved to bug 1620976. Setting attachment 9110916 [details] to obsolete.

Attachment #9110916 - Attachment is obsolete: true
Depends on: 1620976
Flags: needinfo?(mbirghan)

Dana, it looks like this new data storage could effectively be used as a source for (abridged) browser history and should come under our regular data clearing mechanisms, so that "clear recent history...", "forget about this site", the forget button and other mechanisms we have clear the data when the user chooses to do that. Can that happen here, or if not, would you mind filing a follow-up bug to hook this all into nsIClearDataService, if that's not already part of the patches here? That way we don't end up creating a privacy liability when fixing this bug. Thank you!

Flags: needinfo?(dkeeler)

Yes, that can happen here. Thanks for the reminder!

Flags: needinfo?(dkeeler)
Component: Security → Security: PSM
Priority: P3 → P1
Product: Firefox → Core
Whiteboard: [psm-assigned]
Pushed by dluca@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/928233ea49ee
Add permanent storage to user's client certificate selection r=keeler,baku,fluent-reviewers,Gijs
Regressions: 1653550
Flags: needinfo?(mbirghan)
Attachment #9093135 - Attachment is obsolete: true
Pushed by abutkovits@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/441baa36ba93
Add permanent storage to user's client certificate selection r=keeler,baku,fluent-reviewers,Gijs
Pushed by abutkovits@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7142dd253e6d
Add permanent storage to user's client certificate selection r=keeler,baku,fluent-reviewers,Gijs
Regressions: 1656961
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Flags: needinfo?(mbirghan)

I tested the 81 nightly.

Observations:

  • ("Remember this decision" is selected) clicking Cancel does not really Cancel, but remembers "user wants to use the web site without a client certificate"
    On next use, FF will not ask for certificate choice, but proceed with no certificate. This is IMO wrong. Cancel should mean "don't do anything".

  • ("Remember this decision" is NOT selected) clicking Cancel , just brings up the same dialog again. And again. I guess it is displayed for every HTTP request (for every embedded image, JS, CSS and so on ). This is also bad.

Also, in the second case, after I clicked Cancel 5 times, I selected OK. The page was then displayed, but with many elements missing (CSS, images). After I refreshed it, the main HTML did not see the selected certificate (in the first try it did). This is against my expectations. I would expect the first load (when I selected Cancel) to NOT see my certificate, and the second refresh to see it (because I selected one and had the "remember" option selected too).

These observations should in my opinion be handled in a different bug. They seem to show issues with the general client cert dialog.

This patch is focused on how remembering decisions are handled and persistently stored after the user interaction with the client cert dialog.

Indeed - this patch has landed, and we try and stick to 1 issue per bug, or bugs devolve into never-ending sagas where it's unclear which things got fixed for which releases. Please file a bug for the cancel vs. remember behaviour, and a separate one for the refresh behaviour (with more detailed steps and ideally with a testcase, as the behaviour of "the page" may well depend on JS (that was potentially cached from the "cancel" request before?) and to debug that we'd need to see an actual broken case).

Flags: needinfo?(david.balazic)

cancel vs remember is already submitted: bug 537103 , but marked as a duplicate of another bug that is marked INCOMPLETE.
Should I try to revive it or just file a new one?

Flags: needinfo?(david.balazic)

(In reply to David Balažic from comment #50)

cancel vs remember is already submitted: bug 537103 , but marked as a duplicate of another bug that is marked INCOMPLETE.
Should I try to revive it or just file a new one?

Just filing a new one is probably more straightforward. Thank you!

Flags: needinfo?(david.balazic)

OK, opened bug 1657588

Flags: needinfo?(david.balazic)
Depends on: 1657588

and bug 1657591 for the "dialog appears several times"

See Also: → 1209482

Is it really fixed? I recently updated to 91 ESR (Linux), I still have the popup appearing as it did before. I.e. I check "remember choice", hit OK, and some time after (when connection is reestablished, apparently), the dialog appears again. The same with browser restarts.

And somehow hitting Esc (which is easy to do accidentally as this freaking dialog appears randomly) when this dialog appears somehow is remembered very well, as I'm not prompted again (and certificate is not sent) until browser is restarted.

(In reply to WGH from comment #57)

Is it really fixed? I recently updated to 91 ESR (Linux), I still have the popup appearing as it did before. I.e. I check "remember choice", hit OK, and some time after (when connection is reestablished, apparently), the dialog appears again. The same with browser restarts.

Please note, that pop-up confirmation of authentication with selected certificate differs from remembering selected certificate in list of available.

If that's true, then the fix is almost useless. It does not address the main frustration: the dialog appearing over and over again.

I use Firefox v94 and it works fine: I select the certificate for a website and it is remembered "forever". It never asks again (for that website).

The list of remembered certificates choices can be seen in Settings / Certificates / View Certificates , in the tab titled "Authentication Decisions".

Okay, thanks for the input! I have such tab, but its contents are empty. Gotta debug it, and depending on the result, will either post a short comment here, or create a new bug.

I tried to solve this on my own, but I couldn't. I created a new bug 1746532

In the end, this was caused by serial numbers longer than 20 bytes. After I reissued certificate with shorter serial, choice is properly remembered. I also had to manually clean up ClientAuthRememberList.txt to make "Authentication Decisions" tab show anything (having even one long serial breaks it competely, apparently).

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: