com.ning.http.client.AsyncHttpClientConfig.getHostnameVerifier()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中com.ning.http.client.AsyncHttpClientConfig.getHostnameVerifier()方法的一些代码示例,展示了AsyncHttpClientConfig.getHostnameVerifier()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AsyncHttpClientConfig.getHostnameVerifier()方法的具体详情如下:
包路径:com.ning.http.client.AsyncHttpClientConfig
类名称:AsyncHttpClientConfig
方法名:getHostnameVerifier

AsyncHttpClientConfig.getHostnameVerifier介绍

[英]Return the HostnameVerifier
[中]返回主机名验证程序

代码示例

代码示例来源:origin: com.ning/async-http-client

private HttpURLConnection createUrlConnection(Request request) throws IOException, URISyntaxException {
  ProxyServer proxyServer = ProxyUtils.getProxyServer(config, request);
  Realm realm = request.getRealm() != null ? request.getRealm() : config.getRealm();
  Proxy proxy = null;
  if (proxyServer != null || realm != null) {
    try {
      proxy = configureProxyAndAuth(proxyServer, realm);
    } catch (AuthenticationException e) {
      throw new IOException(e.getMessage());
    }
  }
  HttpURLConnection urlConnection = (HttpURLConnection)
    request.getUri().toJavaNetURI().toURL().openConnection(proxy == null ? Proxy.NO_PROXY : proxy);
  if (request.getUri().getScheme().equals("https")) {
    HttpsURLConnection secure = (HttpsURLConnection) urlConnection;
    SSLContext sslContext;
    try {
      sslContext = SslUtils.getInstance().getSSLContext(config);
    } catch (GeneralSecurityException e) {
      throw new IOException(e.getMessage());
    }
    secure.setSSLSocketFactory(sslContext.getSocketFactory());
    secure.setHostnameVerifier(config.getHostnameVerifier());
  }
  return urlConnection;
}

代码示例来源:origin: com.ning/async-http-client

maxRequestRetry = prototype.getMaxRequestRetry();
allowPoolingSslConnections = prototype.isAllowPoolingConnections();
hostnameVerifier = prototype.getHostnameVerifier();
strict302Handling = prototype.isStrict302Handling();
enabledProtocols = prototype.enabledProtocols;

代码示例来源:origin: io.gatling/async-http-client

private HttpURLConnection createUrlConnection(Request request) throws IOException, URISyntaxException {
  ProxyServer proxyServer = ProxyUtils.getProxyServer(config, request);
  Realm realm = request.getRealm() != null ? request.getRealm() : config.getRealm();
  Proxy proxy = null;
  if (proxyServer != null || realm != null) {
    try {
      proxy = configureProxyAndAuth(proxyServer, realm);
    } catch (AuthenticationException e) {
      throw new IOException(e.getMessage());
    }
  }
  HttpURLConnection urlConnection = (HttpURLConnection)
    request.getURI().toURI().toURL().openConnection(proxy == null ? Proxy.NO_PROXY : proxy);
  if (request.getURI().getScheme().equals("https")) {
    HttpsURLConnection secure = (HttpsURLConnection) urlConnection;
    SSLContext sslContext = config.getSSLContext();
    if (sslContext == null) {
      try {
        sslContext = SslUtils.getInstance().getSSLContext(config.isAcceptAnyCertificate());
      } catch (NoSuchAlgorithmException e) {
        throw new IOException(e.getMessage());
      } catch (GeneralSecurityException e) {
        throw new IOException(e.getMessage());
      }
    }
    secure.setSSLSocketFactory(sslContext.getSocketFactory());
    secure.setHostnameVerifier(config.getHostnameVerifier());
  }
  return urlConnection;
}

代码示例来源:origin: io.gatling/async-http-client

provider.clientConfig.getHostnameVerifier();

代码示例来源:origin: io.gatling/async-http-client

final SslHandler sslHandler = ChannelManager.getSslHandler(channel.getPipeline());
final HostnameVerifier hostnameVerifier = config.getHostnameVerifier();
if (hostnameVerifier != null && sslHandler != null) {
  final String host = future.getURI().getHost();

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-client

maxRequestRetry = prototype.getMaxRequestRetry();
allowPoolingSslConnections = prototype.isAllowPoolingConnections();
hostnameVerifier = prototype.getHostnameVerifier();
strict302Handling = prototype.isStrict302Handling();
enabledProtocols = prototype.enabledProtocols;

代码示例来源:origin: io.gatling/async-http-client

allowPoolingSslConnections = prototype.isAllowPoolingConnections();
removeQueryParamOnRedirect = prototype.isRemoveQueryParamOnRedirect();
hostnameVerifier = prototype.getHostnameVerifier();
strict302Handling = prototype.isStrict302Handling();
timeConverter = prototype.timeConverter;

代码示例来源:origin: javaee/grizzly-ahc

maxRequestRetry = prototype.getMaxRequestRetry();
allowPoolingSslConnections = prototype.isAllowPoolingConnections();
hostnameVerifier = prototype.getHostnameVerifier();
strict302Handling = prototype.isStrict302Handling();
enabledProtocols = prototype.enabledProtocols;

代码示例来源:origin: io.gatling/async-http-client

final SwitchingSSLFilter sslFilter =
    new SwitchingSSLFilter(configurator, defaultSecState);
if (clientConfig.getHostnameVerifier() != null) {
  sslFilter.addHandshakeListener(new HostnameVerifierListener());

相关文章

微信公众号

最新文章

更多