MemorizingTrustManager icon indicating copy to clipboard operation
MemorizingTrustManager copied to clipboard

Don't show multiple decision dialogs for same certificate

Open rfc2822 opened this issue 9 years ago • 2 comments

At the moment, when several threads (for instance, synchronization workers called by Android) with MTM simultaneously access a host with unknown certificate, multiple decision activities will pop up, so the user will have to do the same decision multiple times. This makes it look like the application is not working correctly.

If there's already a pending decision for a given certificate, this decision should be waited for/used instead of creating a new one.

rfc2822 avatar Jul 14 '16 16:07 rfc2822

That's an awesome idea. I've encountered that problem myself in yaxim, where the connection times out after some inactivity and a new one is opened.

I estimate that this needs a change of the openDecisions array into a map that is indexed with the server's hostname. However, the TrustManager API does not expose host names, so we'd need to supply it as a constructor parameter (or have some MTM factory that is passed the hostname).

Initially I planned such an API change for the HostnameVerifier implementation, but did it another way in the end.

ge0rg avatar Jul 14 '16 18:07 ge0rg

Any update on this?

PeterEdens avatar Jun 02 '17 01:06 PeterEdens