forked from jglobus/JGlobus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup maven profiles so we can switch between versions of tomcat.
- Loading branch information
Showing
4 changed files
with
271 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ target | |
test-output | ||
*.iml | ||
*.rej | ||
*.patch | ||
*.diff | ||
*.orig | ||
.idea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
diff -ur jglobus-2.0.4.orig/ssl-proxies-tomcat/src/main/java/org/globus/gsi/tomcat/GlobusSSLSocketFactory.java jglobus-2.0.4/ssl-proxies-tomcat/src/main/java/org/globus/gsi/tomcat/GlobusSSLSocketFactory.java | ||
--- jglobus-2.0.4.orig/ssl-proxies-tomcat/src/main/java/org/globus/gsi/tomcat/GlobusSSLSocketFactory.java 2011-07-29 04:41:20.000000000 +0200 | ||
+++ jglobus-2.0.4/ssl-proxies-tomcat/src/main/java/org/globus/gsi/tomcat/GlobusSSLSocketFactory.java 2012-09-30 06:47:06.452646206 +0200 | ||
@@ -15,7 +15,7 @@ | ||
|
||
package org.globus.gsi.tomcat; | ||
|
||
-import org.apache.tomcat.util.net.jsse.JSSESocketFactory; | ||
+import org.apache.tomcat.util.net.jsse.JSSE14SocketFactory; | ||
import org.globus.gsi.X509ProxyCertPathParameters; | ||
import org.globus.gsi.jsse.GlobusSSLHelper; | ||
import org.globus.gsi.provider.GlobusProvider; | ||
@@ -39,50 +39,13 @@ | ||
* @version 1.0 | ||
* @since 1.0 | ||
*/ | ||
-public class GlobusSSLSocketFactory extends JSSESocketFactory { | ||
+public class GlobusSSLSocketFactory extends JSSE14SocketFactory { | ||
|
||
static { | ||
Security.addProvider(new GlobusProvider()); | ||
} | ||
|
||
|
||
- | ||
- /** | ||
- * Create a Globus trust manager which supports proxy certificates. This requires that the CRL store, and | ||
- * signing policy store be configured. | ||
- * | ||
- * @param keystoreType The type of keystore to create. | ||
- * @param keystoreProvider The keystore provider to use. | ||
- * @param algorithm The keystore algorithm. | ||
- * @return A set of configured TrustManagers. | ||
- * @throws Exception If we cannot create the trust managers. | ||
- */ | ||
- @Override | ||
- protected TrustManager[] getTrustManagers(String keystoreType, String keystoreProvider, String algorithm) | ||
- throws Exception { | ||
- KeyStore trustStore = getTrustStore(keystoreType, keystoreProvider); | ||
- CertStore crlStore = null; | ||
- Object crlLocation = attributes.get("crlLocation"); | ||
- if (crlLocation != null) { | ||
- crlStore = GlobusSSLHelper.findCRLStore((String) attributes.get("crlLocation")); | ||
- } | ||
- Object signingPolicyLocation = attributes.get("signingPolicyLocation"); | ||
- ResourceSigningPolicyStore policyStore = null; | ||
- if (signingPolicyLocation != null) { | ||
- policyStore = new ResourceSigningPolicyStore( | ||
- new ResourceSigningPolicyStoreParameters(attributes.get("signingPolicyLocation").toString())); | ||
- } | ||
- Object rejectLimitedProxyEntry = attributes.get("rejectLimitedProxy"); | ||
- | ||
- boolean rejectLimitedProxy = rejectLimitedProxyEntry != null && | ||
- Boolean.parseBoolean(attributes.get("rejectLimitedProxy").toString()); | ||
- X509ProxyCertPathParameters parameters = new X509ProxyCertPathParameters(trustStore, crlStore, policyStore, | ||
- rejectLimitedProxy); | ||
- TrustManager trustManager = new PKITrustManager(new X509ProxyCertPathValidator(), parameters); | ||
- return new TrustManager[]{trustManager}; | ||
- } | ||
- | ||
- | ||
@Override | ||
protected Object clone() throws CloneNotSupportedException { | ||
// TODO Auto-generated method stub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
diff -ur jglobus-2.0.4.orig/ssl-proxies-tomcat/src/main/java/org/globus/gsi/tomcat/GlobusSSLImplementation.java jglobus-2.0.4/ssl-proxies-tomcat/src/main/java/org/globus/gsi/tomcat/GlobusSSLImplementation.java | ||
--- jglobus-2.0.4.orig/ssl-proxies-tomcat/src/main/java/org/globus/gsi/tomcat/GlobusSSLImplementation.java 2011-07-29 04:41:20.000000000 +0200 | ||
+++ jglobus-2.0.4/ssl-proxies-tomcat/src/main/java/org/globus/gsi/tomcat/GlobusSSLImplementation.java 2012-06-08 17:22:01.140977362 +0200 | ||
@@ -1,6 +1,7 @@ | ||
package org.globus.gsi.tomcat; | ||
|
||
|
||
+import org.apache.tomcat.util.net.AbstractEndpoint; | ||
import org.apache.tomcat.util.net.ServerSocketFactory; | ||
import org.apache.tomcat.util.net.jsse.JSSEImplementation; | ||
|
||
@@ -14,8 +15,8 @@ | ||
return "GlobusSSLImplementation"; | ||
} | ||
|
||
- public ServerSocketFactory getServerSocketFactory() { | ||
- return new GlobusSSLSocketFactory(); | ||
+ public ServerSocketFactory getServerSocketFactory(AbstractEndpoint endpoint) { | ||
+ return new GlobusSSLSocketFactory(endpoint); | ||
} | ||
|
||
} | ||
diff -ur jglobus-2.0.4.orig/ssl-proxies-tomcat/src/main/java/org/globus/gsi/tomcat/GlobusSSLSocketFactory.java jglobus-2.0.4/ssl-proxies-tomcat/src/main/java/org/globus/gsi/tomcat/GlobusSSLSocketFactory.java | ||
--- jglobus-2.0.4.orig/ssl-proxies-tomcat/src/main/java/org/globus/gsi/tomcat/GlobusSSLSocketFactory.java 2011-07-29 04:41:20.000000000 +0200 | ||
+++ jglobus-2.0.4/ssl-proxies-tomcat/src/main/java/org/globus/gsi/tomcat/GlobusSSLSocketFactory.java 2012-06-08 18:13:34.293762214 +0200 | ||
@@ -15,6 +15,7 @@ | ||
|
||
package org.globus.gsi.tomcat; | ||
|
||
+import org.apache.tomcat.util.net.AbstractEndpoint; | ||
import org.apache.tomcat.util.net.jsse.JSSESocketFactory; | ||
import org.globus.gsi.X509ProxyCertPathParameters; | ||
import org.globus.gsi.jsse.GlobusSSLHelper; | ||
@@ -44,8 +45,17 @@ | ||
static { | ||
Security.addProvider(new GlobusProvider()); | ||
} | ||
- | ||
- | ||
+ | ||
+ protected Object crlLocation; | ||
+ protected Object signingPolicyLocation; | ||
+ protected Object rejectLimitedProxyEntry; | ||
+ | ||
+ public GlobusSSLSocketFactory(AbstractEndpoint endpoint) { | ||
+ super(endpoint); | ||
+ crlLocation = endpoint.getAttribute("crlLocation"); | ||
+ signingPolicyLocation = endpoint.getAttribute("signingPolicyLocation"); | ||
+ rejectLimitedProxyEntry = endpoint.getAttribute("rejectLimitedProxy"); | ||
+ } | ||
|
||
/** | ||
* Create a Globus trust manager which supports proxy certificates. This requires that the CRL store, and | ||
@@ -61,21 +71,21 @@ | ||
protected TrustManager[] getTrustManagers(String keystoreType, String keystoreProvider, String algorithm) | ||
throws Exception { | ||
KeyStore trustStore = getTrustStore(keystoreType, keystoreProvider); | ||
+ | ||
CertStore crlStore = null; | ||
- Object crlLocation = attributes.get("crlLocation"); | ||
if (crlLocation != null) { | ||
- crlStore = GlobusSSLHelper.findCRLStore((String) attributes.get("crlLocation")); | ||
+ crlStore = GlobusSSLHelper.findCRLStore((String) crlLocation); | ||
} | ||
- Object signingPolicyLocation = attributes.get("signingPolicyLocation"); | ||
+ | ||
ResourceSigningPolicyStore policyStore = null; | ||
if (signingPolicyLocation != null) { | ||
policyStore = new ResourceSigningPolicyStore( | ||
- new ResourceSigningPolicyStoreParameters(attributes.get("signingPolicyLocation").toString())); | ||
+ new ResourceSigningPolicyStoreParameters((String) signingPolicyLocation)); | ||
} | ||
- Object rejectLimitedProxyEntry = attributes.get("rejectLimitedProxy"); | ||
|
||
boolean rejectLimitedProxy = rejectLimitedProxyEntry != null && | ||
- Boolean.parseBoolean(attributes.get("rejectLimitedProxy").toString()); | ||
+ Boolean.parseBoolean((String) rejectLimitedProxyEntry); | ||
+ | ||
X509ProxyCertPathParameters parameters = new X509ProxyCertPathParameters(trustStore, crlStore, policyStore, | ||
rejectLimitedProxy); | ||
TrustManager trustManager = new PKITrustManager(new X509ProxyCertPathValidator(), parameters); |