Skip to content

Commit

Permalink
ZOOKEEPER-2767: Corrected keystore related messages to truststore mess…
Browse files Browse the repository at this point in the history
possible fix for "https://issues.apache.org/jira/browse/ZOOKEEPER-2767"

Author: Ramu <[email protected]>

Reviewers: Michael Han <[email protected]>

Closes apache#263 from ramu11/ZOOKEEPER-2767
  • Loading branch information
kkakarla authored and hanm committed May 26, 2017
1 parent b0b1945 commit 5bfcc13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/java/main/org/apache/zookeeper/common/X509Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ public static SSLContext createSSLContext(ZKConfig config) throws SSLContextExce
String trustStorePasswordProp = config.getProperty(ZKConfig.SSL_TRUSTSTORE_PASSWD);

if (trustStoreLocationProp == null && trustStorePasswordProp == null) {
LOG.warn("keystore not specified for client connection");
LOG.warn("Truststore not specified for client connection");
} else {
if (trustStoreLocationProp == null) {
throw new SSLContextException("keystore location not specified for client connection");
throw new SSLContextException("Truststore location not specified for client connection");
}
if (trustStorePasswordProp == null) {
throw new SSLContextException("keystore password not specified for client connection");
throw new SSLContextException("Truststore password not specified for client connection");
}
try {
trustManagers = new TrustManager[]{
createTrustManager(trustStoreLocationProp, trustStorePasswordProp)};
} catch (TrustManagerException e) {
throw new SSLContextException("Failed to create KeyManager", e);
throw new SSLContextException("Failed to create TrustManager", e);
}
}

Expand Down

0 comments on commit 5bfcc13

Please sign in to comment.