The authentification negotion has to be configured before the connection to the server is establish which happens here in the TCPUtil.getConnector()-method. So we somehow have to configure the system in between the call.

The first thing we need to do is to register a PostProcessor for the IPluginContainer.INSTANCE like this:

This ensures that we can enhance the configured connector and attach a so called INegotiator (in our case a special implementation for responses is available). The implementation to make this happen looks like this: