@Before
  public void setUp() throws Exception {
    clientConf = new Configuration(TEST_UTIL.getConfiguration());
    setSecuredConfiguration(clientConf);
    clientConf.setClass(RpcClientFactory.CUSTOM_RPC_CLIENT_IMPL_CONF_KEY, rpcClientImpl,
      RpcClient.class);
    String serverPrincipalConfigName = "hbase.test.multiple.principal.first";
    String serverPrincipalConfigName2 = "hbase.test.multiple.principal.second";
    clientConf.set(serverPrincipalConfigName, "server/localhost@" + KDC.getRealm());
    clientConf.set(serverPrincipalConfigName2, "server2/localhost@" + KDC.getRealm());
    SecurityInfo securityInfo = new SecurityInfo(Kind.HBASE_AUTH_TOKEN, serverPrincipalConfigName2,
      serverPrincipalConfigName);
    SecurityInfo.addInfo(TestProtobufRpcProto.getDescriptor().getName(), securityInfo);

    UserGroupInformation.setConfiguration(clientConf);
    clientUGI = UserGroupInformation.loginUserFromKeytabAndReturnUGI(CLIENT_PRINCIPAL,
      KEYTAB_FILE.getCanonicalPath());

    rpcServer = RpcServerFactory.createRpcServer(null, getClass().getSimpleName(),
      Lists.newArrayList(
        new RpcServer.BlockingServiceAndInterface(TestProtobufRpcServiceImpl.SERVICE, null)),
      new InetSocketAddress(HOST, 0), TEST_UTIL.getConfiguration(),
      new FifoRpcScheduler(TEST_UTIL.getConfiguration(), 1));
    rpcServer.start();
  }
Test secure client connecting to a non secure server, where we have multiple server principal
candidates for a rpc service. See HBASE-28321.
hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestMultipleServerPrincipalsFallbackToSimple.java