public class HttpClientFactory extends Object
限定符和类型 | 类和说明 |
---|---|
static class |
HttpClientFactory.KitkatSSLSocketFactory |
限定符和类型 | 方法和说明 |
---|---|
static OkHttpClient |
createAuthHttpClient(String username,
String password)
创建 auth认证的 HttpClient
|
static OkHttpClient |
createCertHttpClient(String pattern,
String... pins)
创建 固定证书的 HttpClient
|
static OkHttpClient |
createDefaultHttpClient()
创建默的 HttpClient
|
static OkHttpClient |
createSafeHttpClient(InputStream[] certificates,
InputStream bksFile,
String password)
创建 auth认证的 HttpClient
|
static OkHttpClient |
createUnSafeHttpClient()
创建 不认证证书的 HttpClient
|
static X509TrustManager |
getX509TrustManager() |
public static OkHttpClient createDefaultHttpClient()
public static X509TrustManager getX509TrustManager()
public static OkHttpClient createAuthHttpClient(String username, String password)
username
- 用户名password
- 密码public static OkHttpClient createCertHttpClient(String pattern, String... pins)
pattern
- pins
- public static OkHttpClient createSafeHttpClient(InputStream[] certificates, InputStream bksFile, String password)
certificates
- bksFile
- password
- public static OkHttpClient createUnSafeHttpClient()