Commit daf92ff2 authored by Guus der Kinderen's avatar Guus der Kinderen

OF-1415: Collapse certificate config UI if all connection types use the same config.

parent 2f5191f0
...@@ -2332,6 +2332,8 @@ ssl.certificates.store-management.title=Certificate Stores ...@@ -2332,6 +2332,8 @@ ssl.certificates.store-management.title=Certificate Stores
ssl.certificates.store-management.info-1=Certificates are used (through TLS and SSL protocols) to establish secure connections between servers and clients. When a secured connection is being created, parties can retrieve a certificate from the other party and (amongst others) examine the issuer of those certificates. If the issuer is trusted, a secured layer of communication can be established. ssl.certificates.store-management.info-1=Certificates are used (through TLS and SSL protocols) to establish secure connections between servers and clients. When a secured connection is being created, parties can retrieve a certificate from the other party and (amongst others) examine the issuer of those certificates. If the issuer is trusted, a secured layer of communication can be established.
ssl.certificates.store-management.info-2=Certificates are kept in specialized repositories, or &#39;stores&#39;. Openfire provides two types of stores: <ul><li><em>Identity stores</em> are used to store certificates that identify this instance of Openfire. On request, they certificates from these stores are transmitted to other parties which use them to identify your server. </li> <li><em>Trust stores</em> contain certificates that identify parties that you choose to trust. Trust stores often do not include the certificate from the remote party directly, but instead holds certificates from organizations that are trusted to identify the certificate of the remote party. Such organizations are commonly referred to as "Certificate Authorities".</li></ul> ssl.certificates.store-management.info-2=Certificates are kept in specialized repositories, or &#39;stores&#39;. Openfire provides two types of stores: <ul><li><em>Identity stores</em> are used to store certificates that identify this instance of Openfire. On request, they certificates from these stores are transmitted to other parties which use them to identify your server. </li> <li><em>Trust stores</em> contain certificates that identify parties that you choose to trust. Trust stores often do not include the certificate from the remote party directly, but instead holds certificates from organizations that are trusted to identify the certificate of the remote party. Such organizations are commonly referred to as "Certificate Authorities".</li></ul>
ssl.certificates.store-management.info-3=This section of the admin panel is dedicated to management of the various key and trust stores that act as repositories for sets of security certificates. By default, a small set of stores is re-used for various purposes, but Openfire allows you to configure a distinct set of stores for each connection type. ssl.certificates.store-management.info-3=This section of the admin panel is dedicated to management of the various key and trust stores that act as repositories for sets of security certificates. By default, a small set of stores is re-used for various purposes, but Openfire allows you to configure a distinct set of stores for each connection type.
ssl.certificates.store-management.combined-stores.title=Certificate Stores
ssl.certificates.store-management.combined-stores.info=These stores are used for all encrypted communication. Two stores are provided\: one identity store and a trust store.
ssl.certificates.store-management.socket-c2s-stores.title=XMPP Client Stores ssl.certificates.store-management.socket-c2s-stores.title=XMPP Client Stores
ssl.certificates.store-management.socket-c2s-stores.info=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. ssl.certificates.store-management.socket-c2s-stores.info=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.
ssl.certificates.store-management.socket-s2s-stores.title=Server Federation Stores ssl.certificates.store-management.socket-s2s-stores.title=Server Federation Stores
......
...@@ -23,7 +23,34 @@ ...@@ -23,7 +23,34 @@
final Map<String, String> errors = new HashMap<>(); final Map<String, String> errors = new HashMap<>();
pageContext.setAttribute( "errors", errors ); pageContext.setAttribute( "errors", errors );
pageContext.setAttribute( "connectionTypes", ConnectionType.values() );
// OF-1415: Show distinct boxes for all connection types, but only when their configuration differs!
boolean showAll = false;
CertificateStoreConfiguration identityStoreConfiguration = null;
CertificateStoreConfiguration trustStoreConfiguration = null;
for ( ConnectionType connectionType : ConnectionType.values() )
{
if ( identityStoreConfiguration == null )
{
identityStoreConfiguration = certificateStoreManager.getIdentityStoreConfiguration( connectionType );
}
if ( !identityStoreConfiguration.equals( certificateStoreManager.getIdentityStoreConfiguration( connectionType ) ) )
{
showAll = true;
break;
}
if ( trustStoreConfiguration == null )
{
trustStoreConfiguration = certificateStoreManager.getTrustStoreConfiguration( connectionType );
}
if ( !trustStoreConfiguration.equals( certificateStoreManager.getTrustStoreConfiguration( connectionType ) ) )
{
showAll = true;
break;
}
}
pageContext.setAttribute( "connectionTypes", showAll ? ConnectionType.values() : "COMBINED" );
pageContext.setAttribute( "certificateStoreManager", certificateStoreManager ); pageContext.setAttribute( "certificateStoreManager", certificateStoreManager );
boolean update = request.getParameter("update") != null; boolean update = request.getParameter("update") != null;
...@@ -124,6 +151,7 @@ ...@@ -124,6 +151,7 @@
<c:set var="title"> <c:set var="title">
<c:choose> <c:choose>
<c:when test="${connectionType eq 'COMBINED'}"><fmt:message key="ssl.certificates.store-management.combined-stores.title"/></c:when>
<c:when test="${connectionType eq 'SOCKET_C2S'}"><fmt:message key="ssl.certificates.store-management.socket-c2s-stores.title"/></c:when> <c:when test="${connectionType eq 'SOCKET_C2S'}"><fmt:message key="ssl.certificates.store-management.socket-c2s-stores.title"/></c:when>
<c:when test="${connectionType eq 'SOCKET_S2S'}"><fmt:message key="ssl.certificates.store-management.socket-s2s-stores.title"/></c:when> <c:when test="${connectionType eq 'SOCKET_S2S'}"><fmt:message key="ssl.certificates.store-management.socket-s2s-stores.title"/></c:when>
<c:when test="${connectionType eq 'BOSH_C2S'}"><fmt:message key="ssl.certificates.store-management.bosh-c2s-stores.title"/></c:when> <c:when test="${connectionType eq 'BOSH_C2S'}"><fmt:message key="ssl.certificates.store-management.bosh-c2s-stores.title"/></c:when>
...@@ -135,6 +163,7 @@ ...@@ -135,6 +163,7 @@
<c:set var="description"> <c:set var="description">
<c:choose> <c:choose>
<c:when test="${connectionType eq 'COMBINED'}"><fmt:message key="ssl.certificates.store-management.combined-stores.info"/></c:when>
<c:when test="${connectionType eq 'SOCKET_C2S'}"><fmt:message key="ssl.certificates.store-management.socket-c2s-stores.info"/></c:when> <c:when test="${connectionType eq 'SOCKET_C2S'}"><fmt:message key="ssl.certificates.store-management.socket-c2s-stores.info"/></c:when>
<c:when test="${connectionType eq 'SOCKET_S2S'}"><fmt:message key="ssl.certificates.store-management.socket-s2s-stores.info"/></c:when> <c:when test="${connectionType eq 'SOCKET_S2S'}"><fmt:message key="ssl.certificates.store-management.socket-s2s-stores.info"/></c:when>
<c:when test="${connectionType eq 'BOSH_C2S'}"><fmt:message key="ssl.certificates.store-management.bosh-c2s-stores.info"/></c:when> <c:when test="${connectionType eq 'BOSH_C2S'}"><fmt:message key="ssl.certificates.store-management.bosh-c2s-stores.info"/></c:when>
...@@ -144,6 +173,11 @@ ...@@ -144,6 +173,11 @@
</c:choose> </c:choose>
</c:set> </c:set>
<!-- All connection types share the same config. Pick an arbitrary one to work with. -->
<c:if test="${connectionType eq 'COMBINED'}">
<c:set var="connectionType">SOCKET_C2S</c:set>
</c:if>
<form action="security-certificate-store-management.jsp" method="post"> <form action="security-certificate-store-management.jsp" method="post">
<input type="hidden" name="csrf" value="${csrf}"> <input type="hidden" name="csrf" value="${csrf}">
<input type="hidden" name="connectionType" value="${connectionType}"/> <input type="hidden" name="connectionType" value="${connectionType}"/>
......
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