当前位置: 首页>>代码示例>>Java>>正文


Java HostNameResolver类代码示例

本文整理汇总了Java中org.apache.http.conn.scheme.HostNameResolver的典型用法代码示例。如果您正苦于以下问题:Java HostNameResolver类的具体用法?Java HostNameResolver怎么用?Java HostNameResolver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HostNameResolver类属于org.apache.http.conn.scheme包,在下文中一共展示了HostNameResolver类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SSLSocketFactory

import org.apache.http.conn.scheme.HostNameResolver; //导入依赖的package包/类
public SSLSocketFactory(
        final String algorithm,
        final KeyStore keystore,
        final String keyPassword,
        final KeyStore truststore,
        final SecureRandom random,
        final HostNameResolver nameResolver)
            throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
    this(SSLContexts.custom()
            .useProtocol(algorithm)
            .setSecureRandom(random)
            .loadKeyMaterial(keystore, keyPassword != null ? keyPassword.toCharArray() : null)
            .loadTrustMaterial(truststore)
            .build(),
            nameResolver);
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:17,代码来源:SSLSocketFactory.java

示例2: SSLSocketFactory

import org.apache.http.conn.scheme.HostNameResolver; //导入依赖的package包/类
public SSLSocketFactory(
    String algorithm, 
    final KeyStore keystore, 
    final String keystorePassword, 
    final KeyStore truststore,
    final SecureRandom random,
    final HostNameResolver nameResolver) 
    throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException
{
    super();
    if (algorithm == null) {
        algorithm = TLS;
    }
    KeyManager[] keymanagers = null;
    if (keystore != null) {
        keymanagers = createKeyManagers(keystore, keystorePassword);
    }
    TrustManager[] trustmanagers = null;
    if (truststore != null) {
        trustmanagers = createTrustManagers(truststore);
    }
    this.sslcontext = SSLContext.getInstance(algorithm);
    this.sslcontext.init(keymanagers, trustmanagers, random);
    this.socketfactory = this.sslcontext.getSocketFactory();
    this.nameResolver = nameResolver;
}
 
开发者ID:tdopires,项目名称:cJUnit-mc626,代码行数:27,代码来源:SSLSocketFactory.java

示例3: EasySSLSocketFactory

import org.apache.http.conn.scheme.HostNameResolver; //导入依赖的package包/类
public EasySSLSocketFactory(String algorithm, final KeyStore keystore,
		final String keystorePassword, final KeyStore truststore,
		final SecureRandom random, final HostNameResolver nameResolver)
		throws NoSuchAlgorithmException, KeyManagementException,
		KeyStoreException, UnrecoverableKeyException {
	super();
	if (algorithm == null) {
		algorithm = TLS;
	}
	KeyManager[] keymanagers = null;
	if (keystore != null) {
		keymanagers = createKeyManagers(keystore, keystorePassword);
	}
	TrustManager[] trustmanagers = null;
	if (truststore != null) {
		trustmanagers = createTrustManagers(truststore);
	}
	this.sslcontext = SSLContext.getInstance(algorithm);
	this.sslcontext.init(keymanagers, trustmanagers, random);
	this.socketfactory = this.sslcontext.getSocketFactory();
	this.nameResolver = nameResolver;
}
 
开发者ID:zhangdi0917,项目名称:SexyBelle,代码行数:23,代码来源:EasySSLSocketFactory.java

示例4: AndroidSSLSocketFactory

import org.apache.http.conn.scheme.HostNameResolver; //导入依赖的package包/类
public AndroidSSLSocketFactory(
    String algorithm, 
    final KeyStore keystore, 
    final String keystorePassword, 
    final KeyStore truststore,
    final SecureRandom random,
    final HostNameResolver nameResolver) 
    throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException
{
    super();
    if (algorithm == null) {
        algorithm = TLS;
    }
    KeyManager[] keymanagers = null;
    if (keystore != null) {
        keymanagers = createKeyManagers(keystore, keystorePassword);
    }
    TrustManager[] trustmanagers = null;
    if (truststore != null) {
        trustmanagers = createTrustManagers(truststore);
    }
    this.sslcontext = SSLContext.getInstance(algorithm);
    this.sslcontext.init(keymanagers, new TrustManager[]{HttpClientFactory.TRUST_EVEYONE_MANAGER}, random);
    this.socketfactory = this.sslcontext.getSocketFactory();
    this.nameResolver = nameResolver;
}
 
开发者ID:askeing,项目名称:jplurk,代码行数:27,代码来源:AndroidSSLSocketFactory.java

示例5: SSLSocketFactory

import org.apache.http.conn.scheme.HostNameResolver; //导入依赖的package包/类
/**
 * @deprecated Use {@link #SSLSocketFactory(String, KeyStore, String, KeyStore, SecureRandom, X509HostnameVerifier)}
 */
@Deprecated
public SSLSocketFactory(
        final String algorithm,
        final KeyStore keystore,
        final String keystorePassword,
        final KeyStore truststore,
        final SecureRandom random,
        final HostNameResolver nameResolver)
            throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
    this(createSSLContext(
            algorithm, keystore, keystorePassword, truststore, random, null),
            nameResolver);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:SSLSocketFactory.java

示例6: SimulatedSocketFactory

import org.apache.http.conn.scheme.HostNameResolver; //导入依赖的package包/类
public SimulatedSocketFactory(HostNameResolver hostNameResolver, StreamManager streamManager, int requestTimeout) {
    super();
    assert hostNameResolver != null;
    assert streamManager != null;
    this.hostNameResolver = hostNameResolver;
    this.streamManager = streamManager;
    this.requestTimeout = requestTimeout;
}
 
开发者ID:epam,项目名称:Wilma,代码行数:9,代码来源:SimulatedSocketFactory.java

示例7: TrustingSSLSocketFactory

import org.apache.http.conn.scheme.HostNameResolver; //导入依赖的package包/类
public TrustingSSLSocketFactory(final HostNameResolver nameResolver, final StreamManager streamManager, int timeout) throws KeyManagementException,
    UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException {
    super(SSL, keyStore, keyStorePassword, null, null, trustStrategy, ALLOW_ALL_HOSTNAME_VERIFIER);
    assert nameResolver != null;
    assert streamManager != null;
    this.streamManager = streamManager;
    this.timeout = timeout;
}
 
开发者ID:epam,项目名称:Wilma,代码行数:9,代码来源:TrustingSSLSocketFactory.java


注:本文中的org.apache.http.conn.scheme.HostNameResolver类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。