public boolean matches(final SNIServerName sniServerName) { return sniServerName instanceof SNIHostName && predicate.test(((SNIHostName) sniServerName).getAsciiName()); } };
static List<String> getSniHostNames(SSLParameters sslParameters) { List<SNIServerName> names = sslParameters.getServerNames(); if (names == null || names.isEmpty()) { return Collections.emptyList(); } List<String> strings = new ArrayList<String>(names.size()); for (SNIServerName serverName : names) { if (serverName instanceof SNIHostName) { strings.add(((SNIHostName) serverName).getAsciiName()); } else { throw new IllegalArgumentException("Only " + SNIHostName.class.getName() + " instances are supported, but found: " + serverName); } } return strings; }
static List<String> getSniHostNames(SSLParameters sslParameters) { List<SNIServerName> names = sslParameters.getServerNames(); if (names == null || names.isEmpty()) { return Collections.emptyList(); } List<String> strings = new ArrayList<String>(names.size()); for (SNIServerName serverName : names) { if (serverName instanceof SNIHostName) { strings.add(((SNIHostName) serverName).getAsciiName()); } else { throw new IllegalArgumentException("Only " + SNIHostName.class.getName() + " instances are supported, but found: " + serverName); } } return strings; }
static List<String> getSniHostNames(SSLParameters sslParameters) { List<SNIServerName> names = sslParameters.getServerNames(); if (names == null || names.isEmpty()) { return Collections.emptyList(); } List<String> strings = new ArrayList<String>(names.size()); for (SNIServerName serverName : names) { if (serverName instanceof SNIHostName) { strings.add(((SNIHostName) serverName).getAsciiName()); } else { throw new IllegalArgumentException("Only " + SNIHostName.class.getName() + " instances are supported, but found: " + serverName); } } return strings; }
String host = _host = ((SNIHostName)serverName).getAsciiName(); host = StringUtil.asciiToLowerCase(host);
public boolean matches(final SNIServerName sniServerName) { return sniServerName instanceof SNIHostName && predicate.test(((SNIHostName) sniServerName).getAsciiName()); } };
public boolean matches(final SNIServerName sniServerName) { return sniServerName instanceof SNIHostName && predicate.test(((SNIHostName) sniServerName).getAsciiName()); } };
public boolean matches(final SNIServerName sniServerName) { return sniServerName instanceof SNIHostName && predicate.test(((SNIHostName) sniServerName).getAsciiName()); } };
@Override public boolean matches(SNIServerName serverName) { String hostName = ((SNIHostName)serverName).getAsciiName(); if (provider.match(hostName)) { //Side effect because the client HELLO message is not accessible from the ExtendedKeyManager, so we //cache the matched host name here matchedHostName = serverName; return true; } else { return false; } }
static List<String> getSniHostNames(SSLParameters sslParameters) { List<SNIServerName> names = sslParameters.getServerNames(); if (names == null || names.isEmpty()) { return Collections.emptyList(); } List<String> strings = new ArrayList<String>(names.size()); for (SNIServerName serverName : names) { if (serverName instanceof SNIHostName) { strings.add(((SNIHostName) serverName).getAsciiName()); } else { throw new IllegalArgumentException("Only " + SNIHostName.class.getName() + " instances are supported, but found: " + serverName); } } return strings; }
static List<String> getSniHostNames(SSLParameters sslParameters) { List<SNIServerName> names = sslParameters.getServerNames(); if (names == null || names.isEmpty()) { return Collections.emptyList(); } List<String> strings = new ArrayList<String>(names.size()); for (SNIServerName serverName : names) { if (serverName instanceof SNIHostName) { strings.add(((SNIHostName) serverName).getAsciiName()); } else { throw new IllegalArgumentException("Only " + SNIHostName.class.getName() + " instances are supported, but found: " + serverName); } } return strings; }
static List<String> getSniHostNames(SSLParameters sslParameters) { List<SNIServerName> names = sslParameters.getServerNames(); if (names == null || names.isEmpty()) { return Collections.emptyList(); } List<String> strings = new ArrayList<String>(names.size()); for (SNIServerName serverName : names) { if (serverName instanceof SNIHostName) { strings.add(((SNIHostName) serverName).getAsciiName()); } else { throw new IllegalArgumentException("Only " + SNIHostName.class.getName() + " instances are supported, but found: " + serverName); } } return strings; }
static List<String> getSniHostNames(SSLParameters sslParameters) { List<SNIServerName> names = sslParameters.getServerNames(); if (names == null || names.isEmpty()) { return Collections.emptyList(); } List<String> strings = new ArrayList<String>(names.size()); for (SNIServerName serverName : names) { if (serverName instanceof SNIHostName) { strings.add(((SNIHostName) serverName).getAsciiName()); } else { throw new IllegalArgumentException("Only " + SNIHostName.class.getName() + " instances are supported, but found: " + serverName); } } return strings; }
static List<String> getSniHostNames(SSLParameters sslParameters) { List<SNIServerName> names = sslParameters.getServerNames(); if (names == null || names.isEmpty()) { return Collections.emptyList(); } List<String> strings = new ArrayList<String>(names.size()); for (SNIServerName serverName : names) { if (serverName instanceof SNIHostName) { strings.add(((SNIHostName) serverName).getAsciiName()); } else { throw new IllegalArgumentException("Only " + SNIHostName.class.getName() + " instances are supported, but found: " + serverName); } } return strings; }
static List<String> getSniHostNames(SSLParameters sslParameters) { List<SNIServerName> names = sslParameters.getServerNames(); if (names == null || names.isEmpty()) { return Collections.emptyList(); } List<String> strings = new ArrayList<String>(names.size()); for (SNIServerName serverName : names) { if (serverName instanceof SNIHostName) { strings.add(((SNIHostName) serverName).getAsciiName()); } else { throw new IllegalArgumentException("Only " + SNIHostName.class.getName() + " instances are supported, but found: " + serverName); } } return strings; }
private String retrieveHostName(SSLEngine engine) { ExtendedSSLSession session = (ExtendedSSLSession) engine.getHandshakeSession(); return session.getRequestedServerNames().stream() .filter(name->Predicates.equalTo(StandardConstants.SNI_HOST_NAME).apply(name.getType())) .map(SNIHostName.class::cast) .findFirst() .map(name->name.getAsciiName()).orElse(null); }
private static String extractHostname(SSLSession sslSession) { if (sslSession instanceof ExtendedSSLSession) { for (SNIServerName serverName : ((ExtendedSSLSession) sslSession).getRequestedServerNames()) { if (serverName.getType() == StandardConstants.SNI_HOST_NAME) { return ((SNIHostName) serverName).getAsciiName(); } } } return null; }
static void setSSLParameters( SSLParameters params, SSLParametersImpl impl, AbstractConscryptSocket socket) { Java7PlatformUtil.setSSLParameters(params, impl); impl.setUseCipherSuitesOrder(params.getUseCipherSuitesOrder()); List<SNIServerName> serverNames = params.getServerNames(); if (serverNames != null) { for (SNIServerName serverName : serverNames) { if (serverName.getType() == SNI_HOST_NAME) { socket.setHostname(((SNIHostName) serverName).getAsciiName()); break; } } } }
static void setSSLParameters( SSLParameters params, SSLParametersImpl impl, ConscryptEngine engine) { Java7PlatformUtil.setSSLParameters(params, impl); impl.setUseCipherSuitesOrder(params.getUseCipherSuitesOrder()); List<SNIServerName> serverNames = params.getServerNames(); if (serverNames != null) { for (SNIServerName serverName : serverNames) { if (serverName.getType() == SNI_HOST_NAME) { engine.setHostname(((SNIHostName) serverName).getAsciiName()); break; } } } } static void getSSLParameters(
static void setSSLParameters( SSLParameters params, SSLParametersImpl impl, AbstractConscryptSocket socket) { Java7PlatformUtil.setSSLParameters(params, impl); impl.setUseCipherSuitesOrder(params.getUseCipherSuitesOrder()); List<SNIServerName> serverNames = params.getServerNames(); if (serverNames != null) { for (SNIServerName serverName : serverNames) { if (serverName.getType() == SNI_HOST_NAME) { socket.setHostname(((SNIHostName) serverName).getAsciiName()); break; } } } }