billbarker 2005/04/07 19:49:50
Modified: util/java/org/apache/tomcat/util/net/jsse
JSSESocketFactory.java
Log:
Add support for using "Smart Cards" as trust/keyStore.
Revision Changes Path
1.18 +8 -8
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
Index: JSSESocketFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- JSSESocketFactory.java 29 Aug 2004 17:14:42 -0000 1.17
+++ JSSESocketFactory.java 8 Apr 2005 02:49:50 -0000 1.18
@@ -270,22 +270,22 @@
InputStream istream = null;
try {
ks = KeyStore.getInstance(type);
- File keyStoreFile = new File(path);
- if (!keyStoreFile.isAbsolute()) {
- keyStoreFile = new File(System.getProperty("catalina.base"),
- path);
+ if(! "PKCS11".equalsIgnoreCase(type) ) {
+ File keyStoreFile = new File(path);
+ if (!keyStoreFile.isAbsolute()) {
+ keyStoreFile = new
File(System.getProperty("catalina.base"),
+ path);
+ }
+ istream = new FileInputStream(keyStoreFile);
}
- istream = new FileInputStream(keyStoreFile);
ks.load(istream, pass.toCharArray());
- istream.close();
- istream = null;
} catch (FileNotFoundException fnfe) {
throw fnfe;
} catch (IOException ioe) {
throw ioe;
} catch(Exception ex) {
- ex.printStackTrace();
+ log.error("Exception trying to load keystore " +path,ex);
throw new IOException("Exception trying to load keystore " +
path + ": " + ex.getMessage() );
} finally {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]