You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ge...@apache.org on 2010/11/04 10:19:21 UTC
svn commit: r1030864 -
/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/
Author: genspring
Date: Thu Nov 4 09:19:20 2010
New Revision: 1030864
URL: http://svn.apache.org/viewvc?rev=1030864&view=rev
Log:
Isolate the https protocol and move the ssl implemenations down to https connector gbeans.
Added:
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11APRProtocol.java
- copied, changed from r1030809, geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRProtocol.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11Protocol.java
- copied, changed from r1030809, geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11Protocol.java
Removed:
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11Protocol.java
Modified:
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRConnectorGBean.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRProtocol.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11APRConnectorGBean.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11ConnectorGBean.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11NIOConnectorGBean.java
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java?rev=1030864&r1=1030863&r2=1030864&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java Thu Nov 4 09:19:20 2010
@@ -32,12 +32,8 @@ import org.apache.geronimo.system.server
import org.apache.geronimo.tomcat.TomcatContainer;
@GBean(name="Tomcat Connector")
-public abstract class AbstractHttp11ConnectorGBean extends BaseHttp11ConnectorGBean implements Http11Protocol {
- private String keystoreFileName;
+public abstract class AbstractHttp11ConnectorGBean extends BaseHttp11ConnectorGBean {
- private String truststoreFileName;
-
- private String algorithm;
public AbstractHttp11ConnectorGBean(@ParamAttribute(manageable=false, name = "name") String name,
@ParamAttribute(manageable=false, name = "initParams") Map<String, String> initParams,
@@ -61,167 +57,7 @@ public abstract class AbstractHttp11Conn
return WebManager.PROTOCOL_HTTP;
}
- // Generic SSL
- public String getAlgorithm() {
-
- if ("default".equalsIgnoreCase(algorithm)) {
- return KeyManagerFactory.getDefaultAlgorithm();
- }
- return algorithm;
- }
-
- public String getCiphers() {
- return (String) connector.getAttribute("ciphers");
- }
-
- public String getClientAuth() {
- Object value = connector.getAttribute("clientAuth");
- return value == null ? "false" : value.toString();
- }
-
- public String getKeyAlias() {
- return (String) connector.getAttribute("keyAlias");
- }
-
- public String getKeystoreFile() {
-
- String keystore = (String) connector.getAttribute("keystoreFile");
-
- return getRelatedPathtoCatalinaHome(keystore);
-
- }
-
- public String getKeystoreType() {
- return (String) connector.getAttribute("keystoreType");
- }
-
- public String getSslProtocol() {
- return (String) connector.getAttribute("sslProtocol");
- }
-
- public String getTruststoreFile() {
-
- String truststoreFile = (String) connector.getAttribute("truststoreFile");
-
- return getRelatedPathtoCatalinaHome(truststoreFile);
-
- }
-
- public String getTruststoreType() {
- return (String) connector.getAttribute("truststoreType");
- }
-
- public String getTruststorePass() {
- return (String) connector.getAttribute("truststorePass");
- }
-
- public String getKeystorePass() {
- return (String) connector.getAttribute("keystorePass");
- }
-
- @Persistent(manageable=false)
- public void setAlgorithm(String algorithm) {
- this.algorithm = algorithm;
- if ("default".equalsIgnoreCase(algorithm)) {
- algorithm = KeyManagerFactory.getDefaultAlgorithm();
- }
- connector.setAttribute("algorithm", algorithm);
- }
-
- @Persistent(manageable=false)
- public void setCiphers(String ciphers) {
- connector.setAttribute("ciphers", ciphers);
- }
-
- @Persistent(manageable=false)
- public void setClientAuth(String clientAuth) {
- connector.setAttribute("clientAuth", clientAuth);
- }
-
- @Persistent(manageable=false)
- public void setKeyAlias(String keyAlias) {
- if (keyAlias.equals(""))
- keyAlias = null;
- connector.setAttribute("keyAlias", keyAlias);
- }
-
- @Persistent(manageable=false)
- public void setKeystoreFile(String keystoreFile) {
- if (keystoreFile!= null && keystoreFile.equals(""))
- keystoreFile = null;
-
- keystoreFileName = keystoreFile;
-
- if (keystoreFileName == null) {
-
- connector.setAttribute("keystoreFile", keystoreFileName);
-
- } else {
-
- String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(keystoreFileName);
-
- if (resovledAbsolutePath != null)
- connector.setAttribute("keystoreFile", resovledAbsolutePath);
-
- }
-
- }
-
-
- @Persistent(manageable=false)
- public void setKeystorePass(String keystorePass) {
- if (keystorePass!= null && keystorePass.equals(""))
- keystorePass = null;
- connector.setAttribute("keystorePass", keystorePass);
- }
-
- @Persistent(manageable=false)
- public void setKeystoreType(String keystoreType) {
- if (keystoreType!= null && keystoreType.equals(""))
- keystoreType = null;
- connector.setAttribute("keystoreType", keystoreType);
- }
-
- @Persistent(manageable=false)
- public void setSslProtocol(String sslProtocol) {
- if (sslProtocol!= null && sslProtocol.equals(""))
- sslProtocol = null;
- connector.setAttribute("sslProtocol", sslProtocol);
- }
-
- @Persistent(manageable=false)
- public void setTruststoreFile(String truststoreFile) {
- if (truststoreFile!= null && truststoreFile.equals(""))
- truststoreFile = null;
- truststoreFileName = truststoreFile;
-
- if (truststoreFileName == null) {
- connector.setAttribute("truststoreFile", null);
- }
-
- else {
-
- String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(truststoreFile);
-
- if (resovledAbsolutePath != null)
- connector.setAttribute("truststoreFile", resovledAbsolutePath);
- }
-
- }
-
- @Persistent(manageable=false)
- public void setTruststorePass(String truststorePass) {
- if (truststorePass!= null && truststorePass.equals(""))
- truststorePass = null;
- connector.setAttribute("truststorePass", truststorePass);
- }
-
- @Persistent(manageable=false)
- public void setTruststoreType(String truststoreType) {
- if (truststoreType!= null && truststoreType.equals(""))
- truststoreType = null;
- connector.setAttribute("truststoreType", truststoreType);
- }
+
}
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRConnectorGBean.java?rev=1030864&r1=1030863&r2=1030864&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRConnectorGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRConnectorGBean.java Thu Nov 4 09:19:20 2010
@@ -32,13 +32,7 @@ import org.apache.geronimo.tomcat.Tomcat
@GBean(name="Tomcat Connector HTTP APR")
public class Http11APRConnectorGBean extends BaseHttp11ConnectorGBean implements Http11APRProtocol {
- private String certificateFile;
- private String certificateKeyFile;
- private String caCertificateFile;
- private String caCertificatePath;
- private String certificateChainFile;
- private String revocationPath;
- private String revocationFile;
+
public Http11APRConnectorGBean(@ParamAttribute(manageable=false, name = "name") String name,
@ParamAttribute(manageable=false, name = "initParams") Map<String, String> initParams,
@@ -151,164 +145,11 @@ public class Http11APRConnectorGBean ext
public void setSendfileSize(int sendfileSize) {
connector.setAttribute("sendfileSize", sendfileSize);
}
-
- @Persistent(manageable=false)
- public void setSslCACertificateFile(String sslCACertificateFile) {
- if (sslCACertificateFile != null && sslCACertificateFile.equals(""))
- sslCACertificateFile = null;
- caCertificateFile = sslCACertificateFile;
-
- if (caCertificateFile == null) {
- connector.setAttribute("SSLCACertificateFile", null);
- } else {
-
- String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(caCertificateFile);
-
- if (resovledAbsolutePath != null)
- connector.setAttribute("SSLCACertificateFile", resovledAbsolutePath);
-
- }
- }
-
- @Persistent(manageable=false)
- public void setSslCACertificatePath(String sslCACertificatePath) {
- if (sslCACertificatePath != null && sslCACertificatePath.equals(""))
- sslCACertificatePath = null;
- caCertificatePath = sslCACertificatePath;
-
- if (caCertificatePath == null) {
- connector.setAttribute("SSLCACertificatePath", null);
- } else {
-
- String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(caCertificatePath);
-
- if (resovledAbsolutePath != null)
- connector.setAttribute("SSLCACertificatePath", resovledAbsolutePath);
-
- }
- }
-
- @Persistent(manageable=false)
- public void setSslCertificateChainFile(String sslCertificateChainFile) {
- if (sslCertificateChainFile != null && sslCertificateChainFile.equals(""))
- sslCertificateChainFile = null;
- certificateChainFile = sslCertificateChainFile;
-
- if (certificateChainFile == null) {
- connector.setAttribute("SSLCertificateChainFile", null);
- } else {
-
- String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(certificateChainFile);
-
- if (resovledAbsolutePath != null)
- connector.setAttribute("SSLCertificateChainFile", resovledAbsolutePath);
-
- }
- }
-
- @Persistent(manageable=false)
- public void setSslCertificateFile(String sslCertificateFile) {
- if (sslCertificateFile != null && sslCertificateFile.equals(""))
- sslCertificateFile = null;
- certificateFile = sslCertificateFile;
-
- if (certificateFile == null) {
- connector.setAttribute("SSLCertificateFile", null);
- } else {
-
- String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(certificateFile);
-
- if (resovledAbsolutePath != null)
- connector.setAttribute("SSLCertificateFile", resovledAbsolutePath);
-
- }
- }
-
- @Persistent(manageable=false)
- public void setSslCertificateKeyFile(String sslCertificateKeyFile) {
- if (sslCertificateKeyFile != null && sslCertificateKeyFile.equals(""))
- sslCertificateKeyFile = null;
- certificateKeyFile = sslCertificateKeyFile;
-
- if (certificateKeyFile == null) {
- connector.setAttribute("SSLCertificateKeyFile", null);
- } else {
-
- String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(certificateKeyFile);
-
- if (resovledAbsolutePath != null)
- connector.setAttribute("SSLCertificateKeyFile", resovledAbsolutePath);
-
- }
- }
-
- @Persistent(manageable=false)
- public void setSslCipherSuite(String sslCipherSuite) {
- connector.setAttribute("SSLCipherSuite", sslCipherSuite);
- }
-
- @Persistent(manageable=false)
- public void setSslPassword(String sslPassword) {
- if (sslPassword != null && sslPassword.equals(""))
- sslPassword = null;
- connector.setAttribute("SSLPassword", sslPassword);
- }
-
- @Persistent(manageable=false)
- public void setSslProtocol(String sslProtocol) {
- connector.setAttribute("SSLProtocol", sslProtocol);
- }
-
- @Persistent(manageable=false)
- public void setSslCARevocationFile(String sslCARevocationFile) {
- if (sslCARevocationFile!= null && sslCARevocationFile.equals(""))
- sslCARevocationFile = null;
- revocationFile = sslCARevocationFile;
-
- if (revocationFile == null) {
- connector.setAttribute("SSLCARevocationFile", null);
- } else {
-
- String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(revocationFile);
-
- if (resovledAbsolutePath != null)
- connector.setAttribute("SSLCARevocationFile", resovledAbsolutePath);
-
- }
- }
-
- @Persistent(manageable=false)
- public void setSslCARevocationPath(String sslCARevocationPath) {
- if (sslCARevocationPath!= null && sslCARevocationPath.equals(""))
- sslCARevocationPath = null;
- revocationPath = sslCARevocationPath;
-
- if (revocationPath == null) {
- connector.setAttribute("SSLCARevocationPath", null);
- } else {
-
- String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(revocationPath);
-
- if (resovledAbsolutePath != null)
- connector.setAttribute("SSLCARevocationPath", resovledAbsolutePath);
-
- }
-
- }
-
- @Persistent(manageable=false)
- public void setSslVerifyClient(String sslVerifyClient) {
- connector.setAttribute("SSLVerifyClient", sslVerifyClient);
- }
-
- @Persistent(manageable=false)
- public void setSslVerifyDepth(int sslVerifyDepth) {
- connector.setAttribute("SSLVerifyDepth", sslVerifyDepth);
- }
-
+
@Persistent(manageable=false)
public void setUseSendfile(boolean useSendfile) {
connector.setAttribute("useSendfile", useSendfile);
}
+
}
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRProtocol.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRProtocol.java?rev=1030864&r1=1030863&r2=1030864&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRProtocol.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRProtocol.java Thu Nov 4 09:19:20 2010
@@ -28,32 +28,7 @@ public interface Http11APRProtocol {
public boolean getUseSendfile();
public void setUseSendfile(boolean useSendfile);
public int getSendfileSize();
- public void setSendfileSize(int sendfileSize);
-
- //SSL
- public String getSslProtocol();
- public void setSslProtocol(String sslProtocol);
- public String getSslCipherSuite();
- public void setSslCipherSuite(String sslCipherSuite);
- public String getSslCertificateFile();
- public void setSslCertificateFile(String sslCertificateFile);
- public String getSslCertificateKeyFile();
- public void setSslCertificateKeyFile(String sslCertificateKeyFile);
- public String getSslPassword();
- public void setSslPassword(String sslPassword);
- public String getSslVerifyClient();
- public void setSslVerifyClient(String sslVerifyClient);
- public int getSslVerifyDepth();
- public void setSslVerifyDepth(int sslVerifyDepth);
- public String getSslCACertificateFile();
- public void setSslCACertificateFile(String sslCACertificateFile);
- public String getSslCACertificatePath();
- public void setSslCACertificatePath(String sslCACertificatePath);
- public String getSslCertificateChainFile();
- public void setSslCertificateChainFile(String sslCertificateChainFile);
- public String getSslCARevocationFile();
- public void setSslCARevocationFile(String sslCARevocationFile);
- public String getSslCARevocationPath();
- public void setSslCARevocationPath(String sslCARevocationPath);
+ public void setSendfileSize(int sendfileSize);
+
}
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11APRConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11APRConnectorGBean.java?rev=1030864&r1=1030863&r2=1030864&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11APRConnectorGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11APRConnectorGBean.java Thu Nov 4 09:19:20 2010
@@ -24,13 +24,22 @@ import org.apache.catalina.connector.Con
import org.apache.geronimo.gbean.annotation.GBean;
import org.apache.geronimo.gbean.annotation.ParamAttribute;
import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.Persistent;
import org.apache.geronimo.management.geronimo.WebManager;
import org.apache.geronimo.system.serverinfo.ServerInfo;
import org.apache.geronimo.tomcat.TomcatContainer;
@GBean(name="Tomcat Connector HTTPS APR")
-public class Https11APRConnectorGBean extends Http11APRConnectorGBean {
+public class Https11APRConnectorGBean extends Http11APRConnectorGBean implements Https11APRProtocol{
+ private String certificateFile;
+ private String certificateKeyFile;
+ private String caCertificateFile;
+ private String caCertificatePath;
+ private String certificateChainFile;
+ private String revocationPath;
+ private String revocationFile;
+
public Https11APRConnectorGBean(@ParamAttribute(manageable=false, name = "name") String name,
@ParamAttribute(manageable=false, name = "initParams") Map<String, String> initParams,
@ParamAttribute(manageable=false, name = "host") String host,
@@ -53,5 +62,162 @@ public class Https11APRConnectorGBean ex
public String getGeronimoProtocol(){
return WebManager.PROTOCOL_HTTPS;
}
+
+ @Persistent(manageable=false)
+ public void setSslCACertificateFile(String sslCACertificateFile) {
+ if (sslCACertificateFile != null && sslCACertificateFile.equals(""))
+ sslCACertificateFile = null;
+ caCertificateFile = sslCACertificateFile;
+
+ if (caCertificateFile == null) {
+ connector.setAttribute("SSLCACertificateFile", null);
+ } else {
+
+ String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(caCertificateFile);
+
+ if (resovledAbsolutePath != null)
+ connector.setAttribute("SSLCACertificateFile", resovledAbsolutePath);
+
+ }
+ }
+
+ @Persistent(manageable=false)
+ public void setSslCACertificatePath(String sslCACertificatePath) {
+ if (sslCACertificatePath != null && sslCACertificatePath.equals(""))
+ sslCACertificatePath = null;
+ caCertificatePath = sslCACertificatePath;
+
+ if (caCertificatePath == null) {
+ connector.setAttribute("SSLCACertificatePath", null);
+ } else {
+
+ String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(caCertificatePath);
+
+ if (resovledAbsolutePath != null)
+ connector.setAttribute("SSLCACertificatePath", resovledAbsolutePath);
+
+ }
+ }
+
+ @Persistent(manageable=false)
+ public void setSslCertificateChainFile(String sslCertificateChainFile) {
+ if (sslCertificateChainFile != null && sslCertificateChainFile.equals(""))
+ sslCertificateChainFile = null;
+ certificateChainFile = sslCertificateChainFile;
+
+ if (certificateChainFile == null) {
+ connector.setAttribute("SSLCertificateChainFile", null);
+ } else {
+
+ String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(certificateChainFile);
+
+ if (resovledAbsolutePath != null)
+ connector.setAttribute("SSLCertificateChainFile", resovledAbsolutePath);
+
+ }
+ }
+
+ @Persistent(manageable=false)
+ public void setSslCertificateFile(String sslCertificateFile) {
+ if (sslCertificateFile != null && sslCertificateFile.equals(""))
+ sslCertificateFile = null;
+ certificateFile = sslCertificateFile;
+
+ if (certificateFile == null) {
+ connector.setAttribute("SSLCertificateFile", null);
+ } else {
+
+ String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(certificateFile);
+
+ if (resovledAbsolutePath != null)
+ connector.setAttribute("SSLCertificateFile", resovledAbsolutePath);
+
+ }
+ }
+
+ @Persistent(manageable=false)
+ public void setSslCertificateKeyFile(String sslCertificateKeyFile) {
+ if (sslCertificateKeyFile != null && sslCertificateKeyFile.equals(""))
+ sslCertificateKeyFile = null;
+ certificateKeyFile = sslCertificateKeyFile;
+
+ if (certificateKeyFile == null) {
+ connector.setAttribute("SSLCertificateKeyFile", null);
+ } else {
+
+ String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(certificateKeyFile);
+
+ if (resovledAbsolutePath != null)
+ connector.setAttribute("SSLCertificateKeyFile", resovledAbsolutePath);
+
+ }
+ }
+
+ @Persistent(manageable=false)
+ public void setSslCipherSuite(String sslCipherSuite) {
+ connector.setAttribute("SSLCipherSuite", sslCipherSuite);
+ }
+
+ @Persistent(manageable=false)
+ public void setSslPassword(String sslPassword) {
+ if (sslPassword != null && sslPassword.equals(""))
+ sslPassword = null;
+ connector.setAttribute("SSLPassword", sslPassword);
+ }
+
+ @Persistent(manageable=false)
+ public void setSslProtocol(String sslProtocol) {
+ connector.setAttribute("SSLProtocol", sslProtocol);
+ }
+
+ @Persistent(manageable=false)
+ public void setSslCARevocationFile(String sslCARevocationFile) {
+ if (sslCARevocationFile!= null && sslCARevocationFile.equals(""))
+ sslCARevocationFile = null;
+ revocationFile = sslCARevocationFile;
+
+ if (revocationFile == null) {
+ connector.setAttribute("SSLCARevocationFile", null);
+ } else {
+
+ String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(revocationFile);
+
+ if (resovledAbsolutePath != null)
+ connector.setAttribute("SSLCARevocationFile", resovledAbsolutePath);
+
+ }
+ }
+
+ @Persistent(manageable=false)
+ public void setSslCARevocationPath(String sslCARevocationPath) {
+ if (sslCARevocationPath!= null && sslCARevocationPath.equals(""))
+ sslCARevocationPath = null;
+ revocationPath = sslCARevocationPath;
+
+ if (revocationPath == null) {
+ connector.setAttribute("SSLCARevocationPath", null);
+ } else {
+
+ String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(revocationPath);
+
+ if (resovledAbsolutePath != null)
+ connector.setAttribute("SSLCARevocationPath", resovledAbsolutePath);
+
+ }
+
+ }
+
+ @Persistent(manageable=false)
+ public void setSslVerifyClient(String sslVerifyClient) {
+ connector.setAttribute("SSLVerifyClient", sslVerifyClient);
+ }
+
+ @Persistent(manageable=false)
+ public void setSslVerifyDepth(int sslVerifyDepth) {
+ connector.setAttribute("SSLVerifyDepth", sslVerifyDepth);
+ }
+
+
+
}
Copied: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11APRProtocol.java (from r1030809, geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRProtocol.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11APRProtocol.java?p2=geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11APRProtocol.java&p1=geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRProtocol.java&r1=1030809&r2=1030864&rev=1030864&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRProtocol.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11APRProtocol.java Thu Nov 4 09:19:20 2010
@@ -18,17 +18,8 @@
*/
package org.apache.geronimo.tomcat.connector;
-public interface Http11APRProtocol {
+public interface Https11APRProtocol extends Http11APRProtocol{
- //APR
- public int getPollTime();
- public void setPollTime(int pollTime);
- public int getPollerSize();
- public void setPollerSize(int pollerSize);
- public boolean getUseSendfile();
- public void setUseSendfile(boolean useSendfile);
- public int getSendfileSize();
- public void setSendfileSize(int sendfileSize);
//SSL
public String getSslProtocol();
@@ -55,5 +46,7 @@ public interface Http11APRProtocol {
public void setSslCARevocationFile(String sslCARevocationFile);
public String getSslCARevocationPath();
public void setSslCARevocationPath(String sslCARevocationPath);
+
+
}
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11ConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11ConnectorGBean.java?rev=1030864&r1=1030863&r2=1030864&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11ConnectorGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11ConnectorGBean.java Thu Nov 4 09:19:20 2010
@@ -20,17 +20,27 @@ package org.apache.geronimo.tomcat.conne
import java.util.Map;
+import javax.net.ssl.KeyManagerFactory;
+
import org.apache.catalina.connector.Connector;
import org.apache.geronimo.gbean.annotation.GBean;
import org.apache.geronimo.gbean.annotation.ParamAttribute;
import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.Persistent;
import org.apache.geronimo.management.geronimo.WebManager;
import org.apache.geronimo.system.serverinfo.ServerInfo;
import org.apache.geronimo.tomcat.TomcatContainer;
@GBean(name="Tomcat Connector HTTPS BIO")
-public class Https11ConnectorGBean extends Http11ConnectorGBean {
+public class Https11ConnectorGBean extends Http11ConnectorGBean implements Https11Protocol {
+
+ private String keystoreFileName;
+
+ private String truststoreFileName;
+ private String algorithm;
+
+
public Https11ConnectorGBean(@ParamAttribute(manageable=false, name = "name") String name,
@ParamAttribute(manageable=false, name = "initParams") Map<String, String> initParams,
@ParamAttribute(manageable=false, name = "host") String host,
@@ -53,4 +63,166 @@ public class Https11ConnectorGBean exten
return WebManager.PROTOCOL_HTTPS;
}
+
+ // Generic SSL
+ public String getAlgorithm() {
+
+ if ("default".equalsIgnoreCase(algorithm)) {
+ return KeyManagerFactory.getDefaultAlgorithm();
+ }
+ return algorithm;
+ }
+
+ public String getCiphers() {
+ return (String) connector.getAttribute("ciphers");
+ }
+
+ public String getClientAuth() {
+ Object value = connector.getAttribute("clientAuth");
+ return value == null ? "false" : value.toString();
+ }
+
+ public String getKeyAlias() {
+ return (String) connector.getAttribute("keyAlias");
+ }
+
+ public String getKeystoreFile() {
+
+ String keystore = (String) connector.getAttribute("keystoreFile");
+
+ return getRelatedPathtoCatalinaHome(keystore);
+
+ }
+
+ public String getKeystoreType() {
+ return (String) connector.getAttribute("keystoreType");
+ }
+
+ public String getSslProtocol() {
+ return (String) connector.getAttribute("sslProtocol");
+ }
+
+ public String getTruststoreFile() {
+
+ String truststoreFile = (String) connector.getAttribute("truststoreFile");
+
+ return getRelatedPathtoCatalinaHome(truststoreFile);
+
+ }
+
+ public String getTruststoreType() {
+ return (String) connector.getAttribute("truststoreType");
+ }
+
+ public String getTruststorePass() {
+ return (String) connector.getAttribute("truststorePass");
+ }
+
+ public String getKeystorePass() {
+ return (String) connector.getAttribute("keystorePass");
+ }
+
+ @Persistent(manageable=false)
+ public void setAlgorithm(String algorithm) {
+ this.algorithm = algorithm;
+ if ("default".equalsIgnoreCase(algorithm)) {
+ algorithm = KeyManagerFactory.getDefaultAlgorithm();
+ }
+ connector.setAttribute("algorithm", algorithm);
+ }
+
+ @Persistent(manageable=false)
+ public void setCiphers(String ciphers) {
+ connector.setAttribute("ciphers", ciphers);
+ }
+
+ @Persistent(manageable=false)
+ public void setClientAuth(String clientAuth) {
+ connector.setAttribute("clientAuth", clientAuth);
+ }
+
+ @Persistent(manageable=false)
+ public void setKeyAlias(String keyAlias) {
+ if (keyAlias.equals(""))
+ keyAlias = null;
+ connector.setAttribute("keyAlias", keyAlias);
+ }
+
+ @Persistent(manageable=false)
+ public void setKeystoreFile(String keystoreFile) {
+ if (keystoreFile!= null && keystoreFile.equals(""))
+ keystoreFile = null;
+
+ keystoreFileName = keystoreFile;
+
+ if (keystoreFileName == null) {
+
+ connector.setAttribute("keystoreFile", keystoreFileName);
+
+ } else {
+
+ String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(keystoreFileName);
+
+ if (resovledAbsolutePath != null)
+ connector.setAttribute("keystoreFile", resovledAbsolutePath);
+
+ }
+
+ }
+
+
+ @Persistent(manageable=false)
+ public void setKeystorePass(String keystorePass) {
+ if (keystorePass!= null && keystorePass.equals(""))
+ keystorePass = null;
+ connector.setAttribute("keystorePass", keystorePass);
+ }
+
+ @Persistent(manageable=false)
+ public void setKeystoreType(String keystoreType) {
+ if (keystoreType!= null && keystoreType.equals(""))
+ keystoreType = null;
+ connector.setAttribute("keystoreType", keystoreType);
+ }
+
+ @Persistent(manageable=false)
+ public void setSslProtocol(String sslProtocol) {
+ if (sslProtocol!= null && sslProtocol.equals(""))
+ sslProtocol = null;
+ connector.setAttribute("sslProtocol", sslProtocol);
+ }
+
+ @Persistent(manageable=false)
+ public void setTruststoreFile(String truststoreFile) {
+ if (truststoreFile!= null && truststoreFile.equals(""))
+ truststoreFile = null;
+ truststoreFileName = truststoreFile;
+
+ if (truststoreFileName == null) {
+ connector.setAttribute("truststoreFile", null);
+ }
+
+ else {
+
+ String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(truststoreFile);
+
+ if (resovledAbsolutePath != null)
+ connector.setAttribute("truststoreFile", resovledAbsolutePath);
+ }
+
+ }
+
+ @Persistent(manageable=false)
+ public void setTruststorePass(String truststorePass) {
+ if (truststorePass!= null && truststorePass.equals(""))
+ truststorePass = null;
+ connector.setAttribute("truststorePass", truststorePass);
+ }
+
+ @Persistent(manageable=false)
+ public void setTruststoreType(String truststoreType) {
+ if (truststoreType!= null && truststoreType.equals(""))
+ truststoreType = null;
+ connector.setAttribute("truststoreType", truststoreType);
+ }
}
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11NIOConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11NIOConnectorGBean.java?rev=1030864&r1=1030863&r2=1030864&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11NIOConnectorGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11NIOConnectorGBean.java Thu Nov 4 09:19:20 2010
@@ -20,17 +20,26 @@ package org.apache.geronimo.tomcat.conne
import java.util.Map;
+import javax.net.ssl.KeyManagerFactory;
+
import org.apache.catalina.connector.Connector;
import org.apache.geronimo.gbean.annotation.GBean;
import org.apache.geronimo.gbean.annotation.ParamAttribute;
import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.Persistent;
import org.apache.geronimo.management.geronimo.WebManager;
import org.apache.geronimo.system.serverinfo.ServerInfo;
import org.apache.geronimo.tomcat.TomcatContainer;
@GBean(name="Tomcat Connector HTTPS NIO")
-public class Https11NIOConnectorGBean extends Http11NIOConnectorGBean {
+public class Https11NIOConnectorGBean extends Http11NIOConnectorGBean implements Https11Protocol{
+
+ private String keystoreFileName;
+
+ private String truststoreFileName;
+ private String algorithm;
+
public Https11NIOConnectorGBean(@ParamAttribute(manageable=false, name = "name") String name,
@ParamAttribute(manageable=false, name = "initParams") Map<String, String> initParams,
@ParamAttribute(manageable=false, name = "host") String host,
@@ -53,4 +62,166 @@ public class Https11NIOConnectorGBean ex
return WebManager.PROTOCOL_HTTPS;
}
+ // Generic SSL
+ public String getAlgorithm() {
+
+ if ("default".equalsIgnoreCase(algorithm)) {
+ return KeyManagerFactory.getDefaultAlgorithm();
+ }
+ return algorithm;
+ }
+
+ public String getCiphers() {
+ return (String) connector.getAttribute("ciphers");
+ }
+
+ public String getClientAuth() {
+ Object value = connector.getAttribute("clientAuth");
+ return value == null ? "false" : value.toString();
+ }
+
+ public String getKeyAlias() {
+ return (String) connector.getAttribute("keyAlias");
+ }
+
+ public String getKeystoreFile() {
+
+ String keystore = (String) connector.getAttribute("keystoreFile");
+
+ return getRelatedPathtoCatalinaHome(keystore);
+
+ }
+
+ public String getKeystoreType() {
+ return (String) connector.getAttribute("keystoreType");
+ }
+
+ public String getSslProtocol() {
+ return (String) connector.getAttribute("sslProtocol");
+ }
+
+ public String getTruststoreFile() {
+
+ String truststoreFile = (String) connector.getAttribute("truststoreFile");
+
+ return getRelatedPathtoCatalinaHome(truststoreFile);
+
+ }
+
+ public String getTruststoreType() {
+ return (String) connector.getAttribute("truststoreType");
+ }
+
+ public String getTruststorePass() {
+ return (String) connector.getAttribute("truststorePass");
+ }
+
+ public String getKeystorePass() {
+ return (String) connector.getAttribute("keystorePass");
+ }
+
+ @Persistent(manageable=false)
+ public void setAlgorithm(String algorithm) {
+ this.algorithm = algorithm;
+ if ("default".equalsIgnoreCase(algorithm)) {
+ algorithm = KeyManagerFactory.getDefaultAlgorithm();
+ }
+ connector.setAttribute("algorithm", algorithm);
+ }
+
+ @Persistent(manageable=false)
+ public void setCiphers(String ciphers) {
+ connector.setAttribute("ciphers", ciphers);
+ }
+
+ @Persistent(manageable=false)
+ public void setClientAuth(String clientAuth) {
+ connector.setAttribute("clientAuth", clientAuth);
+ }
+
+ @Persistent(manageable=false)
+ public void setKeyAlias(String keyAlias) {
+ if (keyAlias.equals(""))
+ keyAlias = null;
+ connector.setAttribute("keyAlias", keyAlias);
+ }
+
+ @Persistent(manageable=false)
+ public void setKeystoreFile(String keystoreFile) {
+ if (keystoreFile!= null && keystoreFile.equals(""))
+ keystoreFile = null;
+
+ keystoreFileName = keystoreFile;
+
+ if (keystoreFileName == null) {
+
+ connector.setAttribute("keystoreFile", keystoreFileName);
+
+ } else {
+
+ String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(keystoreFileName);
+
+ if (resovledAbsolutePath != null)
+ connector.setAttribute("keystoreFile", resovledAbsolutePath);
+
+ }
+
+ }
+
+
+ @Persistent(manageable=false)
+ public void setKeystorePass(String keystorePass) {
+ if (keystorePass!= null && keystorePass.equals(""))
+ keystorePass = null;
+ connector.setAttribute("keystorePass", keystorePass);
+ }
+
+ @Persistent(manageable=false)
+ public void setKeystoreType(String keystoreType) {
+ if (keystoreType!= null && keystoreType.equals(""))
+ keystoreType = null;
+ connector.setAttribute("keystoreType", keystoreType);
+ }
+
+ @Persistent(manageable=false)
+ public void setSslProtocol(String sslProtocol) {
+ if (sslProtocol!= null && sslProtocol.equals(""))
+ sslProtocol = null;
+ connector.setAttribute("sslProtocol", sslProtocol);
+ }
+
+ @Persistent(manageable=false)
+ public void setTruststoreFile(String truststoreFile) {
+ if (truststoreFile!= null && truststoreFile.equals(""))
+ truststoreFile = null;
+ truststoreFileName = truststoreFile;
+
+ if (truststoreFileName == null) {
+ connector.setAttribute("truststoreFile", null);
+ }
+
+ else {
+
+ String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(truststoreFile);
+
+ if (resovledAbsolutePath != null)
+ connector.setAttribute("truststoreFile", resovledAbsolutePath);
+ }
+
+ }
+
+ @Persistent(manageable=false)
+ public void setTruststorePass(String truststorePass) {
+ if (truststorePass!= null && truststorePass.equals(""))
+ truststorePass = null;
+ connector.setAttribute("truststorePass", truststorePass);
+ }
+
+ @Persistent(manageable=false)
+ public void setTruststoreType(String truststoreType) {
+ if (truststoreType!= null && truststoreType.equals(""))
+ truststoreType = null;
+ connector.setAttribute("truststoreType", truststoreType);
+ }
+
}
Copied: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11Protocol.java (from r1030809, geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11Protocol.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11Protocol.java?p2=geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11Protocol.java&p1=geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11Protocol.java&r1=1030809&r2=1030864&rev=1030864&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11Protocol.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Https11Protocol.java Thu Nov 4 09:19:20 2010
@@ -18,7 +18,7 @@
*/
package org.apache.geronimo.tomcat.connector;
-public interface Http11Protocol {
+public interface Https11Protocol {
//Https
public String getAlgorithm();