@Test
public void handshakeAndSecureCommand() throws Exception {
PrivateKey nodeKey = TestKeys.privateKey(1);
PrivateKey clientKey = TestKeys.privateKey(2);
BasicHttpServer s = new BasicHttpServer(nodeKey, 15600, 32, log);
BasicHttpClient c = new BasicHttpClient("http://localhost:15600");
c.start(clientKey, nodeKey.getPublicKey(), null);
Binder res = c.command("sping");
assertEquals("spong", res.getStringOrThrow("sping"));
s.addSecureEndpoint("getSessionInfo", (params,session)-> {
return Binder.of("publicKey", session.getPublicKey().info().toString());
});
res = c.command("getSessionInfo");
s.shutdown();
}