[jsslutils commit] r67 - trunk/extra/apachetomcat6/src/main/java/org/jsslutils/extra/apachetomcat6

1 view
Skip to first unread message

codesite...@google.com

unread,
Jan 28, 2009, 9:41:32 AM1/28/09
to jsslut...@googlegroups.com
Author: Bruno.H...@manchester.ac.uk
Date: Wed Jan 28 06:40:21 2009
New Revision: 67

Modified:

trunk/extra/apachetomcat6/src/main/java/org/jsslutils/extra/apachetomcat6/JSSLutilsJSSESocketFactory.java

Log:
Added acceptAnyCert option in JSSLutilsJSSESocketFactory for Apache Tomcat.


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 06:40:21 2009
@@ -35,6 +35,7 @@
import org.jsslutils.keystores.KeyStoreLoader;
import org.jsslutils.sslcontext.PKIXSSLContextFactory;
import org.jsslutils.sslcontext.trustmanagers.GsiWrappingTrustManager;
+import
org.jsslutils.sslcontext.trustmanagers.TrustAllClientsWrappingTrustManager;

/**
* This socket factory is used by the <a
@@ -279,12 +280,19 @@
sslContextFactory.addCrl(crlUrl);
}

- String acceptProxyCertsAttr = (String) attributes
- .get("acceptProxyCerts");
- if ("true".equalsIgnoreCase(acceptProxyCertsAttr)
- || "yes".equalsIgnoreCase(acceptProxyCertsAttr)) {
+ String acceptAnyCert = (String) attributes.get("acceptAnyCert");
+ if ("true".equalsIgnoreCase(acceptAnyCert)
+ || "yes".equalsIgnoreCase(acceptAnyCert)) {
sslContextFactory
- .setTrustManagerWrapper(new GsiWrappingTrustManager.Wrapper());
+ .setTrustManagerWrapper(new
TrustAllClientsWrappingTrustManager.Wrapper());
+ } else {
+ String acceptProxyCertsAttr = (String) attributes
+ .get("acceptProxyCerts");
+ if ("true".equalsIgnoreCase(acceptProxyCertsAttr)
+ || "yes".equalsIgnoreCase(acceptProxyCertsAttr)) {
+ sslContextFactory
+ .setTrustManagerWrapper(new GsiWrappingTrustManager.Wrapper());
+ }
}

// Create and init SSLContext

Reply all
Reply to author
Forward
0 new messages