Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=44968
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 13 May 2008 22:32:17 +0000 (22:32 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 13 May 2008 22:32:17 +0000 (22:32 +0000)
Provide more information when keystore load fails

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@656035 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
java/org/apache/tomcat/util/net/jsse/res/LocalStrings.properties

index 9538edb..337d600 100644 (file)
@@ -321,13 +321,18 @@ public class JSSESocketFactory
 
             ks.load(istream, pass.toCharArray());
         } catch (FileNotFoundException fnfe) {
+            log.error(sm.getString("jsse.keystore_load_failed", type, path,
+                    fnfe.getMessage()));
             throw fnfe;
         } catch (IOException ioe) {
+            log.error(sm.getString("jsse.keystore_load_failed", type, path,
+                    ioe.getMessage()));
             throw ioe;      
         } catch(Exception ex) {
-            log.error("Exception trying to load keystore " +path,ex);
-            throw new IOException("Exception trying to load keystore " +
-                                  path + ": " + ex.getMessage() );
+            String msg = sm.getString("jsse.keystore_load_failed", type, path,
+                    ex.getMessage());
+            log.error(msg);
+            throw new IOException(msg);
         } finally {
             if (istream != null) {
                 try {
index 0b0bea8..79c34c4 100644 (file)
@@ -14,3 +14,4 @@
 # limitations under the License.
 
 jsse.alias_no_key_entry=Alias name {0} does not identify a key entry
+jsse.keystore_load_failed=Failed to load keystore type {0} with path {1} due to {2}