private void tuneConfig(File inputFile, File outputFile, File inHbaFile, File outHbaFile,
			File serverConfigFile) throws SAXException, IOException {
		ErrorHandler handler = SpecXmlUtils.getXmlHandler();
		XmlPullParser parser = new NonThreadedXmlPullParserImpl(serverConfigFile, handler, false);
		ServerConfig serverConfig = new ServerConfig();
		serverConfig.restoreXml(parser);
		if ((port != -1) && (port != 5432)) {
			serverConfig.addKey("port", Integer.toString(port));
		}
		if (localAuthentication == AUTHENTICATION_NONE) {
			serverConfig.setLocalAuthentication(TRUST_METHOD, null);
		}
		else if (localAuthentication == AUTHENTICATION_PASSWORD) {
			serverConfig.setLocalAuthentication(PASSWORD_METHOD, null);
		}
		else if (localAuthentication == AUTHENTICATION_PKI) {
			serverConfig.setLocalAuthentication(CERTIFICATE_METHOD, CERTIFICATE_OPTIONS);
		}
		else {
			throw new IOException("Unsupported local authentication type");
		}
		if (hostAuthentication == AUTHENTICATION_NONE) {
			serverConfig.setHostAuthentication(TRUST_METHOD, null);
		}
		else if (hostAuthentication == AUTHENTICATION_PASSWORD) {
			serverConfig.setHostAuthentication(PASSWORD_METHOD, null);
		}
		else if (hostAuthentication == AUTHENTICATION_PKI) {
			serverConfig.setHostAuthentication(CERTIFICATE_METHOD, CERTIFICATE_OPTIONS);
		}
		else {
			throw new IOException("Unsupported host authentication type");
		}
		if (hostAuthentication == AUTHENTICATION_PKI || localAuthentication == AUTHENTICATION_PKI) {
			serverConfig.addKey("ssl_ca_file", '\'' + POSTGRES_ROOTCA + '\'');	// Turn on certificate authority			
		}
		serverConfig.patchConfig(inputFile, outputFile);
		serverConfig.patchConnect(inHbaFile, outHbaFile);
	}
Tune the postgres configuration and authentication files (postgresql.conf and pg_hba.conf)
based on the command-line options passed in by the user and the ghidra specific configuration options
@param inputFile is the unmodified postgresql.conf file
@param outputFile will hold the new modified version of postgresql.conf
@param inHbaFile is the original pg_hba.conf file
@param outHbaFile will hold the new modified version of pg_hba.conf
@param serverConfigFile is the XML file holding ghidra specific BSim configuration options
@throws SAXException if the xml pull parser cannot be created
@throws IOException if the authentication fails
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimControlLaunchable.java