4646/**
4747 * Utility for properly configuring the SSL Context based on client configuration settings.
4848 */
49- class HttpsContextBuilder {
49+ public class HttpsContextBuilder {
5050 private static final Logger logger = LoggerFactory .getLogger (HttpsContextBuilder .class );
5151
5252 /**
@@ -89,7 +89,7 @@ public LayeredConnectionSocketFactory createSslSocketFactory() {
8989 * Get HostnameVerifier instance based on client configuration.
9090 * @return HostnameVerifier instance.
9191 */
92- HostnameVerifier getHostnameVerifier () {
92+ protected HostnameVerifier getHostnameVerifier () {
9393 // If we're configured to ignore invalid certificates
9494 if (configuration .getIgnoreInvalidSslCertificates ()) {
9595 // Use the Noop verifier.
@@ -103,7 +103,7 @@ HostnameVerifier getHostnameVerifier() {
103103 * Get properly configured SSLContext instance based on client configuration.
104104 * @return SSLContext instance.
105105 */
106- SSLContext getSslContext () {
106+ protected SSLContext getSslContext () {
107107 try {
108108 // Create default SSLContext
109109 final SSLContext sslcontext = SSLContexts .createDefault ();
@@ -121,7 +121,7 @@ SSLContext getSslContext() {
121121 * Based on client configuration, construct KeyManager instances to use.
122122 * @return Array of 0 or more KeyManagers.
123123 */
124- KeyManager [] getKeyManagers () {
124+ protected KeyManager [] getKeyManagers () {
125125 // If not configured to use a KeyStore
126126 if (configuration .getKeyStoreFile () == null ) {
127127 // Return null array.
@@ -160,7 +160,7 @@ KeyManager[] getKeyManagers() {
160160 * Based on Client Configuration, construct TrustManager instances to use.
161161 * @return Array of 0 or more TrustManager instances.
162162 */
163- TrustManager [] getTrustManagers () {
163+ protected TrustManager [] getTrustManagers () {
164164 try {
165165 final TrustManagerFactory trustManagerFactory = TrustManagerFactory .getInstance (TrustManagerFactory .getDefaultAlgorithm ());
166166
@@ -205,7 +205,7 @@ TrustManager[] getTrustManagers() {
205205 * Get allowed SSL Protocols.
206206 * @return allowed SslProtocols.
207207 */
208- private String [] getSslProtocols () {
208+ protected String [] getSslProtocols () {
209209 return sslProtocols ;
210210 }
211211}
0 commit comments