|
@ -40,6 +40,14 @@ public class HttpClientKit {
|
|
|
return new HTTPClientImpl();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 用于无认证和受信证书
|
|
|
* @return HTTPClient
|
|
|
*/
|
|
|
public static HTTPClient getHttpClient() {
|
|
|
return new HTTPClientImpl();
|
|
|
}
|
|
|
|
|
|
private static HTTPClient getHttpClient(String host, Integer port) {
|
|
|
String key = host + ":" + port;
|
|
|
CredentialsProvider credentialsProvider = credentialsProviderMap.get(key);
|
|
@ -54,7 +62,7 @@ public class HttpClientKit {
|
|
|
String key = host + ":" + port;
|
|
|
SSLConnectionSocketFactory sslConnectionSocketFactory = sslConnectionSocketFactoryMap.get(key);
|
|
|
if (sslConnectionSocketFactory == null) {
|
|
|
throw new IllegalArgumentException("must add trust store first.");
|
|
|
throw new IllegalArgumentException("Custom SSL access must add trust store first.");
|
|
|
}
|
|
|
|
|
|
CredentialsProvider credentialsProvider = credentialsProviderMap.get(key);
|