summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorChad Brubaker <cbrubaker@google.com>2015-12-14 12:03:22 -0800
committerandroid-build-merger <android-build-merger@google.com>2015-12-14 12:03:22 -0800
commit4b4a252931e3757df05862f084c684d6a36ff93b (patch)
treecb107908a256a789ac334d38c1c35b44f8a64fff /core/java/android
parentedd137b9b98d6ed8fd3337ce91f529efe9d0aef5 (diff)
parent15ea45c848fbf9e70bbfe6afbfb25d39ce406c80 (diff)
Merge "Check for null hostnames in RootTrustManager" am: 49ce7dc2ba
am: 15ea45c848 * commit '15ea45c848fbf9e70bbfe6afbfb25d39ce406c80': Check for null hostnames in RootTrustManager
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/security/net/config/RootTrustManager.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/security/net/config/RootTrustManager.java b/core/java/android/security/net/config/RootTrustManager.java
index e307ad00275e..b4e58e6e9da6 100644
--- a/core/java/android/security/net/config/RootTrustManager.java
+++ b/core/java/android/security/net/config/RootTrustManager.java
@@ -71,6 +71,10 @@ public class RootTrustManager implements X509TrustManager {
*/
public List<X509Certificate> checkServerTrusted(X509Certificate[] certs, String authType,
String hostname) throws CertificateException {
+ if (hostname == null && mConfig.hasPerDomainConfigs()) {
+ throw new CertificateException(
+ "Domain specific configurations require that the hostname be provided");
+ }
NetworkSecurityConfig config = mConfig.getConfigForHostname(hostname);
return config.getTrustManager().checkServerTrusted(certs, authType, hostname);
}