コード例 #1
0
 private List<LdapName> parseAllowedPrincipals(JolokiaServerConfig pConfig) {
   List<String> principals = pConfig.getClientPrincipals();
   if (principals != null) {
     List<LdapName> ret = new ArrayList<LdapName>();
     for (String principal : principals) {
       try {
         ret.add(new LdapName(principal));
       } catch (InvalidNameException e) {
         throw new IllegalArgumentException(
             "Principal '" + principal + "' cannot be parsed as X500 RDNs");
       }
     }
     return ret;
   } else {
     return null;
   }
 }
コード例 #2
0
 /**
  * Constructor
  *
  * @param pConfig full server config (in contrast to the jolokia config use by the http-handler)
  */
 public ClientCertAuthenticator(JolokiaServerConfig pConfig) {
   useSslClientAuthentication = pConfig.useSslClientAuthentication();
   allowedPrincipals = parseAllowedPrincipals(pConfig);
   extendedClientCheck = pConfig.getExtendedClientCheck();
 }