Skip to content

Allow lib user to change ssl factory #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/**
* Utility for properly configuring the SSL Context based on client configuration settings.
*/
class HttpsContextBuilder {
public class HttpsContextBuilder {
private static final Logger logger = LoggerFactory.getLogger(HttpsContextBuilder.class);

/**
Expand Down Expand Up @@ -89,7 +89,7 @@ public LayeredConnectionSocketFactory createSslSocketFactory() {
* Get HostnameVerifier instance based on client configuration.
* @return HostnameVerifier instance.
*/
HostnameVerifier getHostnameVerifier() {
protected HostnameVerifier getHostnameVerifier() {
// If we're configured to ignore invalid certificates
if (configuration.getIgnoreInvalidSslCertificates()) {
// Use the Noop verifier.
Expand All @@ -103,7 +103,7 @@ HostnameVerifier getHostnameVerifier() {
* Get properly configured SSLContext instance based on client configuration.
* @return SSLContext instance.
*/
SSLContext getSslContext() {
protected SSLContext getSslContext() {
try {
// Create default SSLContext
final SSLContext sslcontext = SSLContexts.createDefault();
Expand All @@ -121,7 +121,7 @@ SSLContext getSslContext() {
* Based on client configuration, construct KeyManager instances to use.
* @return Array of 0 or more KeyManagers.
*/
KeyManager[] getKeyManagers() {
protected KeyManager[] getKeyManagers() {
// If not configured to use a KeyStore
if (configuration.getKeyStoreFile() == null) {
// Return null array.
Expand Down Expand Up @@ -160,7 +160,7 @@ KeyManager[] getKeyManagers() {
* Based on Client Configuration, construct TrustManager instances to use.
* @return Array of 0 or more TrustManager instances.
*/
TrustManager[] getTrustManagers() {
protected TrustManager[] getTrustManagers() {
try {
final TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());

Expand Down Expand Up @@ -205,7 +205,7 @@ TrustManager[] getTrustManagers() {
* Get allowed SSL Protocols.
* @return allowed SslProtocols.
*/
private String[] getSslProtocols() {
protected String[] getSslProtocols() {
return sslProtocols;
}
}