b/2511635 Browser displays incorrect SSL cert information
authorBrian Carlstrom <bdc@google.com>
Thu, 18 Mar 2010 23:56:41 +0000 (16:56 -0700)
committerBrian Carlstrom <bdc@google.com>
Sat, 20 Mar 2010 00:09:01 +0000 (17:09 -0700)
commitdba8cb76371960457e91b31fa396478f809a5a34
treec5f20bb8beb3fa7a44b743f825f755e2449c0a16
parent9f3168b327dbacd99874fb1c423e926b228dd792
b/2511635 Browser displays incorrect SSL cert information

Two more cases of "View certificate" problems like b/2511635

One problem is that if there are multiple resources downloaded for a
page. In that case the mCertificate shown ends up being from the last
loaded resource instead of the main resource of the page. The solution
is to only set the certificate if the LoadListener is the
mIsMainResourceLoader as well as the mIsMainPageLoader.

A larger problem was the fact that the EventHandler.certificate
interface method (in this case the LoadListener.certificate
implementation) once per https connection instead of once per request
as was documented. That meant if an https connection was reused (which
happens frequently on login pages such as
https://www.google.com/accounts which use the POST -> redirect -> GET
idiom to avoid POST data page refresh warnings) then later pages never
were associated with an SslCertificate.

The solution was to change EventHandler.certificate to be called once
per request, specifcally before the request. This means we no longer
call the certificate method in the handleSslErrorRequest case, which
is okay because it includes the SslCertificate within the SslError and
that is what the BrowserActivity expects.

Change-Id: Icbd9bd98c89db82762d1d06de85e1cde2470300d
core/java/android/net/http/Connection.java
core/java/android/net/http/EventHandler.java
core/java/android/net/http/HttpsConnection.java
core/java/android/webkit/BrowserFrame.java
core/java/android/webkit/LoadListener.java
core/java/android/webkit/WebView.java