0
是否有可能在遠程服務器實現中獲取對連接客戶端的x509Certificate對象的引用?帶有SSL客戶端認證的Java RMI:獲取客戶端x509Certificate
Rewrited RMISocketFactory:
RMISocketFactory.setSocketFactory(
new java.rmi.server.RMISocketFactory() {
...
@Override
public ServerSocket createServerSocket(int port)
throws IOException {
SSLServerSocket socket = ...
socket.setNeedClientAuth(true);
return socket;
}
});
遠程對象:
public class RMIServer extends UnicastRemoteObject implements IRMIServer {
public RMIServer() throws RemoteException {
super(0);
}
@Override
public String foo() throws RemoteException {
System.out.println(getClientCertificate().getSubjectDN().getName()); // something like this?
}
}