bitfireAT/cert4android

When timeout occurs Activity is not closed

Closed this issue · 3 comments

When the timeout ends for accepting a new certificate, if the TrustCertificateActivity is open, it's never finished, so the Activity just lays there. It should be closed automatically.

When the timeout ends for accepting a new certificate, if the TrustCertificateActivity is open, it's never finished, so the Activity just lays there. It should be closed automatically.

That's actually by (half) intent. I thought people may need some time to verify the fingerprint, and the visible Activity shouldn't vanish under their hands. So I let it open even if the request was already rejected. But if they accept the certificate, all further requests should be accepted.

In my tests, it works as I have intented: open requests time out, but future requests are behaving as selected by the user.

Steps to reproduce:

  1. Set timeout to 5 sec in code
  2. Start demo, access URL with untrusted cert
  3. Activity opens
  4. Wait 5 sec, timeout is logged in logcat and connection rejected. Activity stays open.
  5. Either reject or accept certificate in the Activity.
  6. For further connections, the cert is either accepted or rejected, as previously selected.

Or does that crash for you?