本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}