package com.yihu.hos.http;

import org.apache.http.client.CredentialsProvider;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.impl.client.HttpClients;

/**
 * 用于非受信证书的HTTPS访问
 *
 * @created Airhead 2016/8/24.
 */
class HTTPSClientImpl extends HTTPClientDefaultImpl {
    HTTPSClientImpl(SSLConnectionSocketFactory sslConnectionSocketFactory) {
        super(HttpClients.custom()
                .setSSLSocketFactory(sslConnectionSocketFactory)
                .build(), null);
    }

    HTTPSClientImpl(SSLConnectionSocketFactory sslConnectionSocketFactory, CredentialsProvider credentialsProvider) {
        super(HttpClients.custom()
                .setSSLSocketFactory(sslConnectionSocketFactory)
                .build(), credentialsProvider);
    }
}
