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

OF-892: The admin panel should give a visual clue for mutual authentication usage.

parent 20be3766
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package org.jivesoftware.openfire.session; package org.jivesoftware.openfire.session;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.security.cert.Certificate;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -354,6 +355,10 @@ public abstract class LocalSession implements Session { ...@@ -354,6 +355,10 @@ public abstract class LocalSession implements Session {
return conn.isSecure(); return conn.isSecure();
} }
public Certificate[] getPeerCertificates() {
return conn.getPeerCertificates();
}
public boolean isClosed() { public boolean isClosed() {
return conn.isClosed(); return conn.isClosed();
} }
......
...@@ -26,6 +26,7 @@ import org.xmpp.packet.JID; ...@@ -26,6 +26,7 @@ import org.xmpp.packet.JID;
import org.xmpp.packet.Packet; import org.xmpp.packet.Packet;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.security.cert.Certificate;
import java.util.Date; import java.util.Date;
/** /**
...@@ -135,6 +136,13 @@ public interface Session extends RoutableChannelHandler { ...@@ -135,6 +136,13 @@ public interface Session extends RoutableChannelHandler {
*/ */
public boolean isSecure(); public boolean isSecure();
/**
* Returns the peer certificates associated with this session, if any.
*
* @return certificates, possibly empty or null.
*/
public Certificate[] getPeerCertificates();
/** /**
* Returns the IP address string in textual presentation. * Returns the IP address string in textual presentation.
* *
......
...@@ -68,15 +68,17 @@ ...@@ -68,15 +68,17 @@
<% } %> <% } %>
</td> </td>
<% if (sess.isSecure()) { %> <td width="1%">
<td width="1%"> <% if (sess.isSecure()) {
<img src="images/lock.gif" width="16" height="16" border="0" if (sess.getPeerCertificates() != null && sess.getPeerCertificates().length > 0) { %>
title="<fmt:message key='session.row.cliked_ssl' />" alt="<fmt:message key='session.row.cliked_ssl' />"> <img src="images/lock_both.gif" width="16" height="16" border="0" title="<fmt:message key='session.row.cliked_ssl' /> (mutual authentication)" alt="<fmt:message key='session.row.cliked_ssl' /> (mutual authentication)">
</td> <% } else { %>
<% } else { %> <img src="images/lock.gif" width="16" height="16" border="0" title="<fmt:message key='session.row.cliked_ssl' />" alt="<fmt:message key='session.row.cliked_ssl' />">
<td width="1%"><img src="images/blank.gif" width="1" height="1" alt=""></td> <% }
<% } %> } else { %>
<img src="images/blank.gif" width="1" height="1" alt="">
<% } %>
</td>
<% Presence.Show _show = sess.getPresence().getShow(); <% Presence.Show _show = sess.getPresence().getShow();
String _stat = sess.getPresence().getStatus(); String _stat = sess.getPresence().getStatus();
if (!sess.getPresence().isAvailable()) { if (!sess.getPresence().isAvailable()) {
......
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