@Before
  public void setUp() throws Exception {
    x509TestContext = PROVIDER.get(X509KeyType.RSA, X509KeyType.RSA, "keyPassword".toCharArray());
    x509TestContext.setConfigurations(KeyStoreFileType.JKS, KeyStoreFileType.JKS);

    Configuration serverConf = new Configuration(UTIL.getConfiguration());
    Configuration clientConf = new Configuration(UTIL.getConfiguration());

    initialize(serverConf, clientConf);

    InetSocketAddress isa = new InetSocketAddress(InetAddress.getLocalHost(), 0);

    rpcServer = new NettyRpcServer(null, "testRpcServer",
      Lists.newArrayList(new RpcServer.BlockingServiceAndInterface(SERVICE, null)), isa, serverConf,
      new FifoRpcScheduler(serverConf, 1), true);
    rpcServer.start();

    rpcClient = new NettyRpcClient(clientConf);
    stub = TestProtobufRpcServiceImpl.newBlockingStub(rpcClient, rpcServer.getListenerAddress());
  }
Tests for client-side mTLS focusing on client hostname verification in the case when client and
server are on different hosts. We try to simulate this behaviour by querying the hostname with
<p>
InetAddress.getLocalHost()
</p>
Certificates are generated with the hostname in Subject Alternative Names, server binds
non-localhost interface and client connects via remote IP address. Parameter is set to verify
both TLS/plaintext and TLS-only cases.
hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestMutualTlsClientSideNonLocalhost.java