public class SSLUtils extends Object
SSLUtils is a singleton utility class that provides convenience methods to obtain secured http clients
CloseableHttpClient| Modifier and Type | Field and Description |
|---|---|
private static SSLUtils |
INSTANCE |
private static Logger |
LOGGER |
| Constructor and Description |
|---|
SSLUtils() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.http.impl.client.CloseableHttpClient |
getHttpsClient(ConnectionConfiguration connectionConfiguration)
Returns an instance of
CloseableHttpClient |
private org.apache.http.impl.client.CloseableHttpClient |
getHttpsClient(String filePath,
char[] storePassword,
char[] keyPassword)
Returns an instance of
CloseableHttpClient |
static SSLUtils |
getInstance()
Returns a lazy loaded singleton instance of
SSLUtils |
public static SSLUtils getInstance()
SSLUtilspublic org.apache.http.impl.client.CloseableHttpClient getHttpsClient(ConnectionConfiguration connectionConfiguration) throws ConnectionException
CloseableHttpClientconnectionConfiguration - has file path to SSL certificate,
password to trust store or keyConnectionException - Exception in case of missing certificate
file, invalid file path or invalid trust
store or key key storeCloseableHttpClient,
ConnectionConfigurationprivate final org.apache.http.impl.client.CloseableHttpClient getHttpsClient(String filePath, char[] storePassword, char[] keyPassword) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException, CertificateException, IOException, Exception
CloseableHttpClientNoSuchAlgorithmExceptionKeyManagementExceptionKeyStoreExceptionUnrecoverableKeyExceptionCertificateExceptionIOExceptionExceptionCopyright © 2016 ADP LLC. All rights reserved.