Home | History | Annotate | Download | only in config

Lines Matching refs:hostname

29  * configuration to be used for communicating with a specific hostname.</p>
59 * Get the {@link NetworkSecurityConfig} corresponding to the provided hostname.
64 * {@code hostname}. Subsequent calls with the same hostname will always return the same
68 * the network security configuration for connections to {@code hostname}.
70 public NetworkSecurityConfig getConfigForHostname(String hostname) {
72 if (hostname == null || hostname.isEmpty() || mConfigs == null) {
75 if (hostname.charAt(0) == '.') {
76 throw new IllegalArgumentException("hostname must not begin with a .");
79 hostname = hostname.toLowerCase(Locale.US);
80 // Normalize hostname by removing trailing . if present, all Domain hostnames are
82 if (hostname.charAt(hostname.length() - 1) == '.') {
83 hostname = hostname.substring(0, hostname.length() - 1);
86 // Domain entry for hostname.
93 if (domain.hostname.equals(hostname)) {
96 // Otherwise check if the Domain includes sub-domains and that the hostname is a
99 && hostname.endsWith(domain.hostname)
100 && hostname.charAt(hostname.length() - domain.hostname.length() - 1) == '.') {
103 } else if (domain.hostname.length() > bestMatch.first.hostname.length()) {
144 * to {@code hostname}.
146 public boolean isCleartextTrafficPermitted(String hostname) {
147 return getConfigForHostname(hostname).isCleartextTrafficPermitted();