Commit 3c1a4efd authored by Guus der Kinderen's avatar Guus der Kinderen

Restoring basic functionality for 'TLS/SSL Certificates' tab in admin console.

parent 1f4d6288
......@@ -28,7 +28,7 @@
<module interface="org.jivesoftware.openfire.OfflineMessageStrategy" implementation="org.jivesoftware.openfire.OfflineMessageStrategy" />
<module interface="org.jivesoftware.openfire.OfflineMessageStore" implementation="org.jivesoftware.openfire.OfflineMessageStore" />
<module interface="org.jivesoftware.openfire.vcard.VCardManager" implementation="org.jivesoftware.openfire.vcard.VCardManager" />
<module interface="org.jivesoftware.openfire.keystore.CertificateStoreManager"" implementation="org.jivesoftware.openfire.keystore.CertificateStoreManager" />
<module interface="org.jivesoftware.openfire.keystore.CertificateStoreManager" implementation="org.jivesoftware.openfire.keystore.CertificateStoreManager" />
<!-- Standard Modules -->
<module interface="org.jivesoftware.openfire.handler.IQBindHandler" implementation="org.jivesoftware.openfire.handler.IQBindHandler" />
......
......@@ -86,7 +86,7 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana
}
final CertificateStoreManager certificateStoreManager = XMPPServer.getInstance().getCertificateStoreManager();
// client-to-server
clientListener = new ConnectionListener(
ConnectionType.SOCKET_C2S,
......
......@@ -143,11 +143,11 @@
<sidebar id="sidebar-certificate-store-socket-c2s" name="${sidebar.client-connections-settings}">
<item id="sidebar-certificate-store-SOCKET_C2S-identity-store" name="Identity Store"
<item id="sidebar-certificate-store-socket_c2s-identity-store" name="Identity Store"
url="security-keystore.jsp?connectionType=SOCKET_C2S"
description="Contains key and certificate that serve as identification of Openfire."/>
<item id="sidebar-certificate-store-SOCKET_C2S-trust-store" name="Trust Store"
<item id="sidebar-certificate-store-socket_c2s-trust-store" name="Trust Store"
url="security-truststore.jsp?connectionType=SOCKET_C2S"
description="Contains certificates that are used to verify the identity of peers."/>
......@@ -155,11 +155,11 @@
<sidebar id="sidebar-certificate-store-socket-s2s" name="${sidebar.server2server-settings}">
<item id="sidebar-certificate-store-SOCKET_S2S-identity-store" name="Identity Store"
<item id="sidebar-certificate-store-socket_s2s-identity-store" name="Identity Store"
url="security-keystore.jsp?connectionType=SOCKET_S2S"
description="Contains key and certificate that serve as identification of Openfire."/>
<item id="sidebar-certificate-store-SOCKET_S2S-trust-store" name="Trust Store"
<item id="sidebar-certificate-store-socket_s2s-trust-store" name="Trust Store"
url="security-truststore.jsp?connectionType=SOCKET_S2S"
description="Contains certificates that are used to verify the identity of peers."/>
......@@ -167,11 +167,11 @@
<sidebar id="sidebar-certificate-store-bosh-c2s" name="${sidebar.http-bind}">
<item id="sidebar-certificate-store-BOSH_C2S-identity-store" name="Identity Store"
<item id="sidebar-certificate-store-bosh_c2s-identity-store" name="Identity Store"
url="security-keystore.jsp?connectionType=BOSH_C2S"
description="Contains key and certificate that serve as identification of Openfire."/>
<item id="sidebar-certificate-store-BOSH_C2S-trust-store" name="Trust Store"
<item id="sidebar-certificate-store-bosh_c2s-trust-store" name="Trust Store"
url="security-truststore.jsp?connectionType=BOSH_C2S"
description="Contains certificates that are used to verify the identity of peers."/>
......@@ -179,11 +179,11 @@
<sidebar id="sidebar-certificate-store-component" name="${sidebar.external-components-settings}">
<item id="sidebar-certificate-store-COMPONENT-identity-store" name="Identity Store"
<item id="sidebar-certificate-store-component-identity-store" name="Identity Store"
url="security-keystore.jsp?connectionType=COMPONENT"
description="Contains key and certificate that serve as identification of Openfire."/>
<item id="sidebar-certificate-store-COMPONENT-trust-store" name="Trust Store"
<item id="sidebar-certificate-store-component-trust-store" name="Trust Store"
url="security-truststore.jsp?connectionType=COMPONENT"
description="Contains certificates that are used to verify the identity of peers."/>
......@@ -191,11 +191,11 @@
<sidebar id="sidebar-certificate-store-connection-manager" name="${sidebar.connection-managers-settings}">
<item id="sidebar-certificate-store-CONNECTION_MANAGER-identity-store" name="Identity Store"
<item id="sidebar-certificate-store-connection_manager-identity-store" name="Identity Store"
url="security-keystore.jsp?connectionType=CONNECTION_MANAGER"
description="Contains key and certificate that serve as identification of Openfire."/>
<item id="sidebar-certificate-store-CONNECTION_MANAGER-trust-store" name="Trust Store"
<item id="sidebar-certificate-store-connection_manager-trust-store" name="Trust Store"
url="security-truststore.jsp?connectionType=CONNECTION_MANAGER"
description="Contains certificates that are used to verify the identity of peers."/>
......@@ -203,11 +203,11 @@
<sidebar id="sidebar-certificate-store-webadmin" name="${admin.console}">
<item id="sidebar-certificate-store-WEBADMIN-identity-store" name="Identity Store"
<item id="sidebar-certificate-store-webadmin-identity-store" name="Identity Store"
url="security-keystore.jsp?connectionType=WEBADMIN"
description="Contains key and certificate that serve as identification of Openfire."/>
<item id="sidebar-certificate-store-WEBADMIN-trust-store" name="Trust Store"
<item id="sidebar-certificate-store-webadmin-trust-store" name="Trust Store"
url="security-truststore.jsp?connectionType=WEBADMIN"
description="Contains certificates that are used to verify the identity of peers."/>
......
......@@ -9,6 +9,7 @@
<%@ taglib uri="admin" prefix="admin" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" />
<% webManager.init(request, response, session, application, out ); %>
......@@ -17,20 +18,20 @@
final String privateKey = ParamUtils.getParameter(request, "private-key");
final String passPhrase = ParamUtils.getParameter(request, "passPhrase");
final String certificate = ParamUtils.getParameter(request, "certificate");
final String storePurposeText = ParamUtils.getParameter(request, "storeConnectionType");
final String storePurposeText = ParamUtils.getParameter(request, "connectionType");
final Map<String, String> errors = new HashMap<String, String>();
ConnectionType storeConnectionType;
ConnectionType connectionType;
try
{
storeConnectionType = ConnectionType.valueOf( storePurposeText );
connectionType = ConnectionType.valueOf( storePurposeText );
} catch (RuntimeException ex) {
errors.put( "storeConnectionType", ex.getMessage() );
storeConnectionType = null;
errors.put( "connectionType", ex.getMessage() );
connectionType = null;
}
pageContext.setAttribute( "storeConnectionType", storeConnectionType );
pageContext.setAttribute( "connectionType", connectionType );
if (save) {
if (privateKey == null || "".equals(privateKey)) {
......@@ -41,7 +42,7 @@
}
if (errors.isEmpty()) {
try {
final IdentityStore identityStore = XMPPServer.getInstance().getCertificateStoreManager().getIdentityStore( storeConnectionType );
final IdentityStore identityStore = XMPPServer.getInstance().getCertificateStoreManager().getIdentityStore( connectionType );
// Create an alias for the signed certificate
String domain = XMPPServer.getInstance().getServerInfo().getXMPPDomain();
......@@ -58,7 +59,7 @@
// Log the event
webManager.logEvent("imported SSL certificate in identity store "+ storePurposeText, "alias = "+alias);
response.sendRedirect("security-keystore.jsp?storeConnectionType="+storePurposeText);
response.sendRedirect("security-keystore.jsp?connectionType="+storePurposeText);
return;
}
catch (Exception e) {
......@@ -71,8 +72,9 @@
<html>
<head>
<title><fmt:message key="ssl.import.certificate.keystore.${storeConnectionType}.title"/></title>
<meta name="pageID" content="security-keystore-${storeConnectionType}"/>
<title><fmt:message key="ssl.import.certificate.keystore.${connectionType}.title"/></title>
<meta name="pageID" content="security-certificate-store-management"/>
<meta name="subPageID" content="sidebar-certificate-store-${fn:toLowerCase(connectionType)}-identity-store"/>
</head>
<body>
......@@ -114,7 +116,7 @@
<!-- BEGIN 'Import Private Key and Certificate' -->
<form action="import-keystore-certificate.jsp" method="post" name="f">
<input type="hidden" name="storeConnectionType" value="${storeConnectionType}"/>
<input type="hidden" name="connectionType" value="${connectionType}"/>
<div class="jive-contentBoxHeader">
<fmt:message key="ssl.import.certificate.keystore.boxtitle" />
</div>
......
......@@ -9,6 +9,7 @@
<%@ taglib uri="admin" prefix="admin" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager"/>
<% webManager.init(request, response, session, application, out ); %>
......@@ -16,24 +17,24 @@
<% final boolean save = ParamUtils.getParameter(request, "save") != null;
final String alias = ParamUtils.getParameter(request, "alias");
final String certificate = ParamUtils.getParameter(request, "certificate");
final String storePurposeText = ParamUtils.getParameter(request, "storeConnectionType");
final String storePurposeText = ParamUtils.getParameter(request, "connectionType");
final Map<String, String> errors = new HashMap<String, String>();
ConnectionType storeConnectionType;
ConnectionType connectionType;
try
{
storeConnectionType = ConnectionType.valueOf( storePurposeText );
connectionType = ConnectionType.valueOf( storePurposeText );
} catch (RuntimeException ex) {
errors.put( "storeConnectionType", ex.getMessage() );
storeConnectionType = null;
errors.put( "connectionType", ex.getMessage() );
connectionType = null;
}
pageContext.setAttribute( "storeConnectionType", storeConnectionType );
pageContext.setAttribute( "connectionType", connectionType );
if (save && errors.isEmpty())
{
final TrustStore trustStoreConfig = XMPPServer.getInstance().getCertificateStoreManager().getTrustStore( storeConnectionType );
final TrustStore trustStoreConfig = XMPPServer.getInstance().getCertificateStoreManager().getTrustStore( connectionType );
if (alias == null || "".equals(alias))
{
......@@ -59,7 +60,7 @@
// Log the event
webManager.logEvent("imported SSL certificate in trust store "+ storePurposeText, "alias = "+alias);
response.sendRedirect( "security-truststore.jsp?storeConnectionType=" + storePurposeText + "&importsuccess=true" );
response.sendRedirect( "security-truststore.jsp?connectionType=" + storePurposeText + "&importsuccess=true" );
return;
}
catch (Throwable e)
......@@ -74,9 +75,10 @@
<html>
<head>
<title>
<fmt:message key="ssl.import.certificate.keystore.${storeConnectionType}.title"/> - <fmt:message key="ssl.certificates.truststore.${param.type}-title"/>
<fmt:message key="ssl.import.certificate.keystore.${connectionType}.title"/> - <fmt:message key="ssl.certificates.truststore.${param.type}-title"/>
</title>
<meta name="pageID" content="security-truststore-${storeConnectionType}-${param.type}"/>
<meta name="pageID" content="security-certificate-store-management"/>
<meta name="subPageID" content="sidebar-certificate-store-${fn:toLowerCase(connectionType)}-identity-store"/>
</head>
<body>
......@@ -124,7 +126,7 @@
<!-- BEGIN 'Import Certificate' -->
<form action="import-truststore-certificate.jsp?type=${param.type}" method="post" name="f">
<input type="hidden" name="connectivityType" value="${storeConnectionType}"/>
<input type="hidden" name="connectivityType" value="${connectionType}"/>
<div class="jive-contentBoxHeader">
<fmt:message key="ssl.import.certificate.keystore.boxtitle"/>
</div>
......
......@@ -21,21 +21,21 @@
<% webManager.init(request, response, session, application, out );
final String alias = ParamUtils.getParameter( request, "alias" );
final String storePurposeText = ParamUtils.getParameter( request, "storeConnectionType" );
final String storePurposeText = ParamUtils.getParameter( request, "connectionType" );
final boolean isTrustStore = ParamUtils.getBooleanParameter( request, "isTrustStore" );
final Map<String, String> errors = new HashMap<String, String>();
ConnectionType storeConnectionType;
ConnectionType connectionType;
try
{
storeConnectionType = ConnectionType.valueOf( storePurposeText );
connectionType = ConnectionType.valueOf( storePurposeText );
} catch (RuntimeException ex) {
errors.put( "storeConnectionType", ex.getMessage() );
storeConnectionType = null;
errors.put( "connectionType", ex.getMessage() );
connectionType = null;
}
pageContext.setAttribute( "storeConnectionType", storeConnectionType );
pageContext.setAttribute( "connectionType", connectionType );
if (alias == null) {
errors.put("alias", "The alias has not been specified.");
......@@ -47,9 +47,9 @@
final CertificateStoreManager certificateStoreManager = XMPPServer.getInstance().getCertificateStoreManager();
final CertificateStore store;
if (isTrustStore) {
store = certificateStoreManager.getTrustStore( storeConnectionType );
store = certificateStoreManager.getTrustStore( connectionType );
} else {
store = certificateStoreManager.getIdentityStore( storeConnectionType );
store = certificateStoreManager.getIdentityStore( connectionType );
}
// Get the certificate
......@@ -71,9 +71,9 @@
// Handle a "go back" click:
if ( request.getParameter( "back" ) != null ) {
if ( isTrustStore ) {
response.sendRedirect( "security-truststore.jsp?storeConnectionType=" + storeConnectionType );
response.sendRedirect( "security-truststore.jsp?connectionType=" + connectionType );
} else {
response.sendRedirect( "security-keystore.jsp?storeConnectionType=" + storeConnectionType );
response.sendRedirect( "security-keystore.jsp?connectionType=" + connectionType );
}
return;
}
......@@ -84,12 +84,13 @@
<html>
<head>
<title><fmt:message key="ssl.certificate.details.title"/></title>
<meta name="pageID" content="security-certificate-store-management"/>
<c:choose>
<c:when test="${isTrustStore}">
<meta name="pageID" content="security-truststore"/>
<meta name="subPageID" content="sidebar-certificate-store-${fn:toLowerCase(connectionType)}-trust-store"/>
</c:when>
<c:otherwise>
<meta name="pageID" content="security-keystore"/>
<meta name="subPageID" content="sidebar-certificate-store-${fn:toLowerCase(connectionType)}-identity-store"/>
</c:otherwise>
</c:choose>
</head>
......@@ -449,7 +450,8 @@
<br/>
<form action="security-certificate-details.jsp">
<input type="hidden" name="storeConnectionType" value="${storeConnectionType}"/>
<input type="hidden" name="connectionType" value="${connectionType}"/>
<input type="hidden" name="isTrustStore" value="${param.isTrustStore}"/>
<div style="text-align: center;">
<input type="submit" name="back" value="<fmt:message key="session.details.back_button"/>">
</div>
......
......@@ -17,18 +17,18 @@
final Map<String, String> errors = new HashMap<>();
pageContext.setAttribute( "errors", errors );
pageContext.setAttribute( "connectionTypes", ConnectionType.values() );
pageContext.setAttribute( "certificateStoreManager", XMPPServer.getInstance().getCertificateStoreManager());
pageContext.setAttribute( "certificateStoreManager", XMPPServer.getInstance().getCertificateStoreManager() );
%>
<html>
<head>
<title>Certificate Stores</title>
<meta name="pageID" content="security-certificate-store-management"/>
</head>
<body>
<c:forEach var="err" items="${errors}">
<admin:infobox type="error">
<c:choose>
<!--Use the template below for specific error messages. -->
<c:when test="${err.key eq 'template'}">
An unexpected error occurred.
</c:when>
......@@ -69,25 +69,63 @@
<c:forEach items="${connectionTypes}" var="connectionType">
<c:set var="trustStore" value="${certificateStoreManager.
<admin:contentBox title="XMPP Client Connection Stores">
<c:set var="title">
<c:choose>
<c:when test="${connectionType eq 'SOCKET_C2S'}">XMPP Client Stores</c:when>
<c:when test="${connectionType eq 'SOCKET_S2S'}">Server Federation Stores</c:when>
<c:when test="${connectionType eq 'BOSH_C2S'}">BOSH (HTTP Binding) Stores</c:when>
<c:when test="${connectionType eq 'WEBADMIN'}">Admin Console Stores</c:when>
<c:when test="${connectionType eq 'COMPONENT'}">External Component Stores</c:when>
<c:when test="${connectionType eq 'CONNECTION_MANAGER'}">Connection Manager Stores</c:when>
</c:choose>
</c:set>
<c:set var="description">
<c:choose>
<c:when test="${connectionType eq 'SOCKET_C2S'}">
These stores are used for regular, TCP-based client-to-server XMPP communication. Two stores are provided:
one identity store and a trust store. Openfire ships with an empty trust store, as in typical
environments, certificate-based authentication of clients is not required.
</c:when>
<c:when test="${connectionType eq 'SOCKET_S2S'}">
These stores are used for erver-to-server XMPP communication, which establishes server federation.
Two stores are provided: one identity store and a trust store. Openfire ships with a trust store filled
with certificates of generally accepted certificate authorities.
</c:when>
<c:when test="${connectionType eq 'BOSH_C2S'}">
These stores are used for BOSH-based XMPP communication. Two stores are provided: an identity store
and a client trust store.
</c:when>
<c:when test="${connectionType eq 'WEBADMIN'}">
These stores are used for the web-based admin console (you're looking at it right now!). Again, two stores are
provided an identity store and a trust store (used for optional authentication of browsers that use the admin
panel).
</c:when>
<c:when test="${connectionType eq 'COMPONENT'}">
These stores are used to establish connections with external components.
</c:when>
<c:when test="${connectionType eq 'CONNECTION_MANAGER'}">
These stores are used to establish connections with Openfire Connection Managers.
</c:when>
</c:choose>
</c:set>
<admin:contentBox title="${title}">
<p>
These stores are used for regular, TCP-based client-to-server XMPP communication. Two stores are provided:
one identity store and a trust store. Openfire ships with an empty client trust store, as in typical
environments, certificate-based authentication of clients is not required.
<c:out value="${description}"/>
</p>
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td><label for="loc-key-socket">Identity Store:</label></td>
<td><input id="loc-key-socket" name="loc-key-socket" type="text" size="40" value="${locKeySocket}"/></td>
<td><input id="loc-key-socket" name="loc-key-socket" type="text" size="80" readonly value="${certificateStoreManager.getIdentityStore(connectionType).configuration.file}"/></td>
<td><a href="security-keystore.jsp?connectionType=${connectionType}">Manage Store Contents</a></td>
</tr>
<tr>
<td><label for="loc-trust-socket-c2s">Trust Store:</label></td>
<td><input id="loc-trust-socket-c2s" name="loc-trust-socket-c2s" type="text" size="40" value="${locTrustSocketC2S}"/></td>
<td><a href="security-truststore.jsp?storeConnectionType=${connectionType}">Manage Store Contents</a></td>
<td><input id="loc-trust-socket-c2s" name="loc-trust-socket-c2s" type="text" size="80" readonly value="${certificateStoreManager.getTrustStore(connectionType).configuration.file}"/></td>
<td><a href="security-truststore.jsp?connectionType=${connectionType}">Manage Store Contents</a></td>
</tr>
</tbody>
</table>
......@@ -96,89 +134,5 @@
</c:forEach>
<div class="jive-contentBoxHeader">
BOSH (HTTP Binding) connection Stores
</div>
<div class="jive-contentBox">
<p>
These stores are used for BOSH-based XMPP communication. Two stores are provided: an identity store
and a client trust store (a server trust store is not provided, as BOSH-based server federation is
unsupported by Openfire).
</p>
<p>
Openfire ships with an empty client trust store, as in typical environments, certificate-based authentication of
clients is not required.
</p>
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td><label for="loc-key-bosh">Identity Store:</label></td>
<td><input id="loc-key-bosh" name="loc-key-bosh" type="text" size="40" value="${locKeyBosh}"/></td>
<td><a href="security-keystore.jsp?storeConnectionType=BOSHBASED_IDENTITYSTORE">Manage Store Contents</a></td>
</tr>
<tr>
<td><label for="loc-trust-bosh-c2s">Client Trust Store:</label></td>
<td><input id="loc-trust-bosh-c2s" name="loc-trust-bosh-c2s" type="text" size="40" value="${locTrustBoshC2S}"/></td>
<td><a href="security-truststore.jsp?storeConnectionType=BOSHBASED_C2S_TRUSTSTORE">Manage Store Contents</a></td>
</tr>
</tbody>
</table>
</div>
<div class="jive-contentBoxHeader">
Admin Panel Stores
</div>
<div class="jive-contentBox">
<p>
These stores are used for the web-based admin panel (you're looking at it right now!). Again, two stores are
provided an identity store and a trust store (used for optional authentication of browsers that use the admin
panel).
</p>
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td><label for="loc-key-webadmin">Identity Store:</label></td>
<td><input id="loc-key-webadmin" name="loc-key-webadmin" type="text" size="40" value="${locKeyWebadmin}"/></td>
<td><a href="security-keystore.jsp?storeConnectionType=WEBADMIN_IDENTITYSTORE">Manage Store Contents</a></td>
</tr>
<tr>
<td><label for="loc-trust-webadmin">Trust Store:</label></td>
<td><input id="loc-trust-webadmin" name="loc-trust-webadmin" type="text" size="40" value="${locTrustWebadmin}"/></td>
<td><a href="security-keystore.jsp?storeConnectionType=WEBADMIN_TRUSTSTORE">Manage Store Contents</a></td>
</tr>
</tbody>
</table>
</div>
<div class="jive-contentBoxHeader">
Administrative Stores
</div>
<div class="jive-contentBox">
<p>
These stores are used in communication with external servers that serves administrative purposes (such as user
providers or databases).
</p>
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td><label for="loc-key-administrative">Identity Store:</label></td>
<td><input id="loc-key-administrative" name="loc-key-administrative" type="text" size="40" value="${locKeyAdministrative}"/></td>
<td><a href="security-keystore.jsp?storeConnectionType=ADMINISTRATIVE_IDENTITYSTORE">Manage Store Contents</a></td>
</tr>
<tr>
<td><label for="loc-trust-administrative">Trust Store:</label></td>
<td><input id="loc-trust-administrative" name="loc-trust-administrative" type="text" size="40" value="${locTrustAdministrative}"/></td>
<td><a href="security-truststore.jsp?storeConnectionType=ADMINISTRATIVE_TRUSTSTORE">Manage Store Contents</a></td>
</tr>
</tbody>
</table>
</div>
</form>
-->
</body>
</html>
......@@ -141,6 +141,7 @@
<html>
<head>
<title><fmt:message key="ssl.certificates.keystore.title"/></title>
<meta name="pageID" content="security-certificate-store-management"/>
<meta name="subPageID" content="sidebar-certificate-store-${fn:toLowerCase(connectionType)}-identity-store"/>
</head>
<body>
......@@ -274,7 +275,7 @@
%>
<tr valign="top">
<td>
<a href="security-certificate-details.jsp?connectionType=${connectionType}&alias=${alias}" title="<fmt:message key='session.row.cliked'/>">
<a href="security-certificate-details.jsp?connectionType=${connectionType}&alias=${alias}&isTrustStore=false" title="<fmt:message key='session.row.cliked'/>">
<c:forEach items="${identities}" var="currentItem" varStatus="stat">
<c:out value="${stat.first ? '' : ','} ${currentItem}"/>
</c:forEach>
......
......@@ -45,7 +45,7 @@
pageContext.setAttribute( "connectionType", connectionType );
pageContext.setAttribute( "trustStore", trustStore );
final Set<ConnectionType> sameStoreConnectionTypes = Collections.EMPTY_SET; // TODO FIXME: SSLConfig.getInstance().getOtherPurposesForSameStore( storeConnectionType );
final Set<ConnectionType> sameStoreConnectionTypes = Collections.EMPTY_SET; // TODO FIXME: SSLConfig.getInstance().getOtherPurposesForSameStore( connectionType );
pageContext.setAttribute( "sameStoreConnectionTypes", sameStoreConnectionTypes );
final Map<String, X509Certificate> certificates = trustStore.getAllCertificates();
......@@ -82,7 +82,8 @@
<html>
<head>
<title><fmt:message key="certificate-management.connectionType.${connectionType}.title"/></title>
<meta name="pageID" content="security-truststore"/>
<meta name="pageID" content="security-certificate-store-management"/>
<meta name="subPageID" content="sidebar-certificate-store-${fn:toLowerCase(connectionType)}-trust-store"/>
<style>
.info-header {
background-color: #eee;
......@@ -139,39 +140,41 @@
</p>
<table border="0" width="100%">
<td valign="top" width="60%">
<table cellpadding="2" cellspacing="2" border="0" class="info-table">
<thead>
<tr><th colspan="2" class="info-header">Store Configuration</th></tr>
</thead>
<tbody>
<tr>
<td class="c1">File location:</td>
<td class="c2"><c:out value="${trustStore.configuration.file}"/></td>
</tr>
<tr>
<td class="c1">Type:</td>
<td class="c2"><c:out value="${trustStore.configuration.type}"/></td>
</tr>
<tr>
<td class="c1">Password:</td>
<td class="c2"><c:out value="${trustStore.configuration.password}"/></td>
</tr>
</tbody>
</table>
</td>
<td valign="top" width="40%">
<c:if test="${not empty sameStoreConnectionTypes}">
<admin:infobox type="info">
This store is re-used for these additional purposes. Any changes to this store will also affect that functionality!
<ul style="margin-top: 1em;">
<c:forEach var="sameStorePurpose" items="${sameStoreConnectionTypes}">
<li><fmt:message key="certificate-management.connectionType.${sameStorePurpose}.title"/></li>
</c:forEach>
</ul>
</admin:infobox>
</c:if>
</td>
<tr>
<td valign="top" width="60%">
<table cellpadding="2" cellspacing="2" border="0" class="info-table">
<thead>
<tr><th colspan="2" class="info-header">Store Configuration</th></tr>
</thead>
<tbody>
<tr>
<td class="c1">File location:</td>
<td class="c2"><c:out value="${trustStore.configuration.file}"/></td>
</tr>
<tr>
<td class="c1">Type:</td>
<td class="c2"><c:out value="${trustStore.configuration.type}"/></td>
</tr>
<tr>
<td class="c1">Password:</td>
<td class="c2"><c:out value="${trustStore.configuration.password}"/></td>
</tr>
</tbody>
</table>
</td>
<td valign="top" width="40%">
<c:if test="${not empty sameStoreConnectionTypes}">
<admin:infobox type="info">
This store is re-used for these additional purposes. Any changes to this store will also affect that functionality!
<ul style="margin-top: 1em;">
<c:forEach var="sameStorePurpose" items="${sameStoreConnectionTypes}">
<li><fmt:message key="certificate-management.connectionType.${sameStorePurpose}.title"/></li>
</c:forEach>
</ul>
</admin:infobox>
</c:if>
</td>
</tr>
</table>
......@@ -230,7 +233,7 @@
<tr valign="top">
<td>
<a href="security-certificate-details.jsp?connectionType=${connectionType}&alias=${alias}" title="<fmt:message key='session.row.cliked'/>">
<a href="security-certificate-details.jsp?connectionType=${connectionType}&alias=${alias}&isTrustStore=true" title="<fmt:message key='session.row.cliked'/>">
<c:choose>
<c:when test="${empty fn:trim(organization)}">
<c:out value="${commonname}"/>
......
......@@ -18,20 +18,20 @@
final String city = ParamUtils.getParameter(request, "city");
final String state = ParamUtils.getParameter(request, "state");
final String countryCode = ParamUtils.getParameter(request, "country");
final String storePurposeText = ParamUtils.getParameter(request, "storeConnectionType");
final String storePurposeText = ParamUtils.getParameter(request, "connectionType");
final Map<String, String> errors = new HashMap<String, String>();
ConnectionType storeConnectionType;
ConnectionType connectionType;
try
{
storeConnectionType = ConnectionType.valueOf( storePurposeText );
connectionType = ConnectionType.valueOf( storePurposeText );
} catch (RuntimeException ex) {
errors.put( "storeConnectionType", ex.getMessage() );
storeConnectionType = null;
errors.put( "connectionType", ex.getMessage() );
connectionType = null;
}
pageContext.setAttribute( "storeConnectionType", storeConnectionType );
pageContext.setAttribute( "connectionType", connectionType );
// if (save) {
//
......@@ -56,7 +56,7 @@
// }
// if (errors.size() == 0) {
// try {
// final IdentityStore identityStoreConfig = (IdentityStore) SSLConfig.getInstance().getStoreConfig( storeConnectionType );
// final IdentityStore identityStoreConfig = (IdentityStore) SSLConfig.getInstance().getStoreConfig( connectionType );
//
// identityStoreConfig.ensureSelfSignedDomainCertificates( name, organizationalUnit, organization, city, state, countryCode, "rsa", "dsa" );
// // Regenerate self-sign certs whose subjectDN matches the issuerDN and set the new issuerDN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment