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

OF-892: Retrieve peer certificates from remote sessions.

parent 823252d7
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
package org.jivesoftware.openfire.plugin.session; package org.jivesoftware.openfire.plugin.session;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.security.cert.Certificate;
import java.util.Date; import java.util.Date;
import org.jivesoftware.openfire.SessionManager; import org.jivesoftware.openfire.SessionManager;
...@@ -120,6 +121,11 @@ public abstract class RemoteSession implements Session { ...@@ -120,6 +121,11 @@ public abstract class RemoteSession implements Session {
return (String) doSynchronousClusterTask(task); return (String) doSynchronousClusterTask(task);
} }
public Certificate[] getPeerCertificates() {
ClusterTask task = getRemoteSessionTask(RemoteSessionTask.Operation.getPeerCertificates);
return (Certificate[]) doSynchronousClusterTask(task);
}
public void process(Packet packet) { public void process(Packet packet) {
doClusterTask(getProcessPacketTask(packet)); doClusterTask(getProcessPacketTask(packet));
} }
......
...@@ -76,6 +76,9 @@ public abstract class RemoteSessionTask implements ClusterTask { ...@@ -76,6 +76,9 @@ public abstract class RemoteSessionTask implements ClusterTask {
else if (operation == Operation.getCipherSuiteName) { else if (operation == Operation.getCipherSuiteName) {
result = getSession().getCipherSuiteName(); result = getSession().getCipherSuiteName();
} }
else if (operation == Operation.getPeerCertificates) {
result = getSession().getPeerCertificates();
}
else if (operation == Operation.close) { else if (operation == Operation.close) {
// Run in another thread so we avoid blocking calls (in hazelcast) // Run in another thread so we avoid blocking calls (in hazelcast)
final Session session = getSession(); final Session session = getSession();
...@@ -143,6 +146,7 @@ public abstract class RemoteSessionTask implements ClusterTask { ...@@ -143,6 +146,7 @@ public abstract class RemoteSessionTask implements ClusterTask {
getNumClientPackets, getNumClientPackets,
getNumServerPackets, getNumServerPackets,
getCipherSuiteName, getCipherSuiteName,
getPeerCertificates,
close, close,
isClosed, isClosed,
isSecure, isSecure,
......
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