geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r474398 - in /geronimo/server/trunk: applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/ applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/ modu...
Date Mon, 13 Nov 2006 17:10:24 GMT
Author: vamsic007
Date: Mon Nov 13 09:10:23 2006
New Revision: 474398

URL: http://svn.apache.org/viewvc?view=rev&rev=474398
Log:
GERONIMO-2278 Problems in editing Jetty SSL Connector and the edit page in Geronimo Console

Modified:
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp
    geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettySecureConnector.java

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java?view=diff&rev=474398&r1=474397&r2=474398
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
Mon Nov 13 09:10:23 2006
@@ -157,7 +157,8 @@
                         throw new PortletException(e);
                     }
                     String trustStore = actionRequest.getParameter("unlockTrustStore");
-                    if(isValid(trustStore)) {setProperty(secure, "trustStore", trustStore);}
+                    // "" is a valid trustStore value, which means the parameter should be
cleared
+                    setProperty(secure, "trustStore", isValid(trustStore) ? trustStore :
null);
                 } else if (server.equals(WEB_SERVER_TOMCAT)) {
                     if(isValid(truststoreType)) {setProperty(secure, "truststoreType", truststoreType);}
                     if(isValid(truststoreFile)) {setProperty(secure, "truststoreFileName",
truststoreFile);}
@@ -218,6 +219,29 @@
                     secure.setClientAuthRequired(clientAuth);
                     if(server.equals(WEB_SERVER_JETTY)) {
                         if(isValid(privateKeyPass)) {setProperty(secure, "keyPassword", privateKeyPass);}
+                        String keyStore = actionRequest.getParameter("unlockKeyStore");
+                        String trustStore = actionRequest.getParameter("unlockTrustStore");
+                        setProperty(secure, "keyStore", keyStore);
+                        try {
+                            KeystoreInstance[] keystores = PortletManager.getCurrentServer(actionRequest).getKeystoreManager().getKeystores();
+
+                            String[] keys = null;
+                            for (int i = 0; i < keystores.length; i++) {
+                                KeystoreInstance keystore = keystores[i];
+                                if(keystore.getKeystoreName().equals(keyStore)) {
+                                    keys = keystore.getUnlockedKeys(null);
+                                }
+                            }
+                            if(keys != null && keys.length == 1) {
+                                setProperty(secure, "keyAlias", keys[0]);
+                            } else {
+                                throw new PortletException("Cannot handle keystores with
anything but 1 unlocked private key");
+                            }
+                        } catch (KeystoreException e) {
+                            throw new PortletException(e);
+                        }
+                        // "" is a valid trustStore value, which means the parameter should
be cleared
+                        setProperty(secure, "trustStore", isValid(trustStore) ? trustStore
: null);
                     }
                     else if (server.equals(WEB_SERVER_TOMCAT)) {
                         if(isValid(truststoreType)) {setProperty(secure, "truststoreType",
truststoreType);}
@@ -401,8 +425,12 @@
                         if(secure.isClientAuthRequired()) {
                             renderRequest.setAttribute("clientAuth", Boolean.TRUE);
                         }
-                        if(server.equals(WEB_SERVER_TOMCAT)) {
-                            String truststoreFile = (String)getProperty(secure, "truststoreFileName");
+                        if(server.equals(WEB_SERVER_JETTY)) {
+                            String keyStore = (String)getProperty(secure, "keyStore");
+                            String trustStore = (String)getProperty(secure, "trustStore");
+                            renderRequest.setAttribute("unlockKeyStore", keyStore);
+                            renderRequest.setAttribute("unlockTrustStore", trustStore);
+                        } else if(server.equals(WEB_SERVER_TOMCAT)) {                   
        String truststoreFile = (String)getProperty(secure, "truststoreFileName");
                             String truststoreType = (String)getProperty(secure, "truststoreType");
                             renderRequest.setAttribute("truststoreFile", truststoreFile);
                             renderRequest.setAttribute("truststoreType", truststoreType);

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp?view=diff&rev=474398&r1=474397&r2=474398
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp
Mon Nov 13 09:10:23 2006
@@ -119,7 +119,7 @@
         <td>
           <select name="unlockKeyStore">
               <c:forEach var="store" items="${keyStores}">
-                  <option>${store}</option>
+                  <option<c:if test="${unlockKeyStore eq store}"> selected</c:if>>${store}</option>
               </c:forEach>
           </select>
         </td>
@@ -136,7 +136,7 @@
           <select name="unlockTrustStore">
               <option />
               <c:forEach var="store" items="${trustStores}">
-                  <option>${store}</option>
+                  <option<c:if test="${unlockTrustStore eq store}"> selected</c:if>>${store}</option>
               </c:forEach>
           </select>
         </td>
@@ -253,7 +253,7 @@
     <td>
       <select name="algorithm">
         <option value="Default"<c:if test="${algorithm eq 'Default' || algorithm eq
''}"> selected</c:if>>JVM Default</option>
-        <option value="SunX509"<c:if test="${algorithm eq 'SunX509' eq ''}"> selected</c:if>>Sun</option>
+        <option value="SunX509"<c:if test="${algorithm eq 'SunX509'}"> selected</c:if>>Sun</option>
         <option value="IbmX509"<c:if test="${algorithm eq 'IbmX509'}"> selected</c:if>>IBM</option>
       </select>
 	</td>

Modified: geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettySecureConnector.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettySecureConnector.java?view=diff&rev=474398&r1=474397&r2=474398
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettySecureConnector.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettySecureConnector.java
Mon Nov 13 09:10:23 2006
@@ -27,4 +27,10 @@
     public void setTrustStore(String trustStore);
 
     public void setKeyAlias(String keyAlias);
+
+    public String getKeyStore();
+
+    public String getTrustStore();
+
+    public String getKeyAlias();
 }



Mime
View raw message