rlevas commented on a change in pull request #69: KNOX-1812 - The Knox Gateway 
truststore should be configurable
URL: https://github.com/apache/knox/pull/69#discussion_r264292027
 
 

 ##########
 File path: 
gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultKeystoreService.java
 ##########
 @@ -448,6 +437,48 @@ public String getKeystorePath() {
     return config.getIdentityKeystorePath();
   }
 
+  /**
+   * Loads a keystore file.
+   * <p>
+   * if <code>failIfNotAccessible</code> is <code>true</code>, then the path 
to the keystore file
+   * (keystorePath) is validated such that it exists, is a file and can be 
read by the process. If
+   * any of these checks fail, a {@link KeystoreServiceException} is thrown in 
dicatating the exact
+   * reason.
+   * <p>
+   * Before the keystore file is loaded, the service's read lock is locked to 
prevent concurrent
+   * reads on the file.
+   *
+   * @param keystorePath        the path to the keystore file
+   * @param keystoreType        the type of keystore file
+   * @param alias               the alias for the password to the keystore 
file (see {@link #getKeystorePassword(String)})
+   * @param failIfNotAccessible <code>true</code> to ensure the keystore file 
exists and is readable; <code>false</code> to not check
+   * @return a {@link KeyStore}, or <code>null</code> if the requested 
keystore cannot be created
+   * @throws KeystoreServiceException if an error occurs loading the keystore 
file
+   */
+  private KeyStore getKeystore(String keystorePath, String keystoreType, 
String alias, boolean failIfNotAccessible) throws KeystoreServiceException {
 
 Review comment:
   I will change this...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to