X509Certificate serverCert =
getAuthManager().getServerCertificate(session);
serverPrincipal = serverCert != null
? serverCert.getSubjectX500Principal() : null;
if (serverPrincipal != null) {
authPermission = new AuthenticationPermission(
Collections.singleton(serverPrincipal),
(clientPrincipal != null
? Collections.singleton(clientPrincipal) : null),
"accept");
}