Skip to content

Commit d9151bf

Browse files
kristianmonsenSteve Block
authored andcommitted
Hook up WebView.clearSslPreferences() for the Chromium HTTP stack
Note that this is an incomplete fix, as we do not clear the responses for connections currently in use, as they maintain their own cache. See http:/b/5324235. Bug: 5287216 Change-Id: I18f6638efeff0bee1e7ffed606be1444d683bebd
1 parent 9a0cd15 commit d9151bf

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

core/java/android/webkit/SslCertLookupTable.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,8 @@ public void setIsAllowed(SslError sslError, boolean allow) {
4646
public boolean isAllowed(SslError sslError) {
4747
return table.getBoolean(sslError.toString());
4848
}
49+
50+
public void clear() {
51+
table.clear();
52+
}
4953
}

core/java/android/webkit/WebViewCore.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,8 +1349,14 @@ public void handleMessage(Message msg) {
13491349
}
13501350

13511351
case CLEAR_SSL_PREF_TABLE:
1352-
Network.getInstance(mContext)
1353-
.clearUserSslPrefTable();
1352+
if (JniUtil.useChromiumHttpStack()) {
1353+
// FIXME: This will not work for connections currently in use, as
1354+
// they cache the certificate responses. See http://b/5324235.
1355+
SslCertLookupTable.getInstance().clear();
1356+
nativeCloseIdleConnections();
1357+
} else {
1358+
Network.getInstance(mContext).clearUserSslPrefTable();
1359+
}
13541360
break;
13551361

13561362
case TOUCH_UP:

0 commit comments

Comments
 (0)