I've adopted an option similar to your second option. My transMasterXMLImpl class basically translating a
Java function call seekAuthorization() into an XML document according to the XML-RPC API specification. It will also open a secure SSL connection using javax.net.ssl.SSLSocket (from JSSE API), negotiating an SSL connection with the TransMaster Server using the reference to a keystore which holds the keys to provide mutual authentication. The server
thread will wait until TransMaster replies with a response XML document. The TransMasterXMLImpl class will then translate the XML document and return a boolean value to the system.