Skip to content

Commit

Permalink
GEODE-6746: Log hostname validation disabled once. (apache#3559)
Browse files Browse the repository at this point in the history
        * Using the same logic used by configShown boolean flag
	* The flag is set the first time the log is printed.
	* Log level set to info rather than warn.
  • Loading branch information
nabarunnag authored May 8, 2019
1 parent 9a75bf0 commit 41928ea
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ public class SocketCreator {
* Only print this SocketCreator's config once
*/
private boolean configShown = false;
/**
* Only print hostname validation disabled log once
*/
private boolean hostnameValidationDisabledLogShown = false;


/**
* context for SSL socket factories
Expand Down Expand Up @@ -1062,9 +1067,12 @@ private void configureClientSSLSocket(Socket socket, int timeout) throws IOExcep
sslParameters.setEndpointIdentificationAlgorithm("HTTPS");
sslSocket.setSSLParameters(sslParameters);
} else {
logger.warn("Your SSL configuration disables hostname validation. "
+ "ssl-endpoint-identification-enabled should be set to true when SSL is enabled. "
+ "Please refer to the Apache GEODE SSL Documentation for SSL Property: ssl‑endpoint‑identification‑enabled");
if (!hostnameValidationDisabledLogShown) {
logger.info("Your SSL configuration disables hostname validation. "
+ "ssl-endpoint-identification-enabled should be set to true when SSL is enabled. "
+ "Please refer to the Apache GEODE SSL Documentation for SSL Property: ssl‑endpoint‑identification‑enabled");
hostnameValidationDisabledLogShown = true;
}
}

String[] protocols = this.sslConfig.getProtocolsAsStringArray();
Expand Down

0 comments on commit 41928ea

Please sign in to comment.