Modified:
trunk/extra/apachetomcat6/pom.xml
trunk/extra/apachetomcat6/src/main/java/org/jsslutils/extra/apachetomcat6/JSSLutilsJSSESocketFactory.java
Log:
Fixed keypass/keyPass, keystore/keystoreFile attribute names issue, and
changed version number.
Modified: trunk/extra/apachetomcat6/pom.xml
==============================================================================
--- trunk/extra/apachetomcat6/pom.xml (original)
+++ trunk/extra/apachetomcat6/pom.xml Wed Jan 28 08:13:43 2009
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jsslutils</groupId>
<artifactId>jsslutils-extra-apachetomcat6</artifactId>
- <version>0.5.1</version>
+ <version>0.5.2</version>
<packaging>jar</packaging>
<name>jSSLutils :: Extra :: SSLImplementation for Apache Tomcat 6</name>
<url>http://www.jsslutils.org/</url>
Modified:
trunk/extra/apachetomcat6/src/main/java/org/jsslutils/extra/apachetomcat6/JSSLutilsJSSESocketFactory.java
==============================================================================
---
trunk/extra/apachetomcat6/src/main/java/org/jsslutils/extra/apachetomcat6/JSSLutilsJSSESocketFactory.java
(original)
+++
trunk/extra/apachetomcat6/src/main/java/org/jsslutils/extra/apachetomcat6/JSSLutilsJSSESocketFactory.java
Wed Jan 28 08:13:43 2009
@@ -208,7 +208,6 @@
*/
void init() throws IOException {
try {
-
String clientAuthStr = (String) attributes.get("clientauth");
if ("true".equalsIgnoreCase(clientAuthStr)
|| "yes".equalsIgnoreCase(clientAuthStr)) {
@@ -222,11 +221,13 @@
if (protocol == null) {
protocol = defaultProtocol;
}
-
- String keyPassAttr = (String) attributes.get("keyPass");
+
+ String keyPassAttr = (String) attributes.get("keypass");
KeyStoreLoader ksl = KeyStoreLoader.getKeyStoreDefaultLoader();
String keystoreFileAttr = (String) attributes.get("keystoreFile");
+ if (keystoreFileAttr == null)
+ keystoreFileAttr = (String) attributes.get("keystore");
if (keystoreFileAttr != null) {
ksl.setKeyStorePath(keystoreFileAttr.length() == 0 ? null
: keystoreFileAttr);
@@ -269,15 +270,20 @@
.setKeyStoreProvider(truststoreProviderAttr.length() == 0 ? null
: truststoreProviderAttr);
}
+
+ KeyStore keyStore = ksl.loadKeyStore();
+ KeyStore trustStore = tsl.loadKeyStore();
PKIXSSLContextFactory sslContextFactory = new PKIXSSLContextFactory(
- ksl.loadKeyStore(), keyPassAttr, tsl.loadKeyStore());
+ keyStore, keyPassAttr, trustStore);
String crlURLsAttr = (String) attributes.get("crlURLs");
- StringTokenizer st = new StringTokenizer(crlURLsAttr, " ");
- while (st.hasMoreTokens()) {
- String crlUrl = st.nextToken();
- sslContextFactory.addCrl(crlUrl);
+ if (crlURLsAttr != null) {
+ StringTokenizer st = new StringTokenizer(crlURLsAttr, " ");
+ while (st.hasMoreTokens()) {
+ String crlUrl = st.nextToken();
+ sslContextFactory.addCrl(crlUrl);
+ }
}
String acceptAnyCert = (String) attributes.get("acceptAnyCert");