private static Certificate[] testServerSSLConnection(ServerInfo server, TaskMonitor monitor)
			throws IOException, CancelledException {

		RMIServerPortFactory portFactory = new RMIServerPortFactory(server.getPortNumber());
		SslRMIClientSocketFactory factory = new SslRMIClientSocketFactory();
		String serverName = server.getServerName();
		int sslRmiPort = portFactory.getRMISSLPort();

		monitor.setCancelEnabled(true);
		monitor.setMessage("Checking Server Liveness...");
		
		// Perform simple socket test connection with short timeout to verify connectivity.
		try (Socket socket = new FastConnectionFailSocket(serverName, sslRmiPort);
				ConnectCancelledListener cancelListener =
					new ConnectCancelledListener(monitor, () -> forceClose(socket))) {
			// do nothing - connect occurs during instantiation
		}
		finally {
			monitor.checkCancelled(); // circumvent any IOException which may have occured
		}

		// Perform secure socket test connection to prime keystore use without RMI involvement
		try (SSLSocket socket = (SSLSocket) factory.createSocket(serverName, sslRmiPort);
				ConnectCancelledListener cancelListener =
					new ConnectCancelledListener(monitor, () -> forceClose(socket))) {
			// Complete SSL handshake to trigger client keystore access if required
			// which will give user ability to cancel without involving RMI which 
			// will avoid RMI reconnect attempts
			socket.startHandshake();
			return socket.getSession().getPeerCertificates();
		}
		finally {
			monitor.checkCancelled(); // circumvent any IOException which may have occured
		}
	}
Initiate an SSLSocket connection in order to ensure that any neccesary client/server
certificate validation is performed.
@param server server to which connection should be verified.  For the Ghidra Server 
this should correspond to the RMI Registry port {@link GhidraServerHandle#DEFAULT_PORT}.
@param monitor connection task monitor
@return certificate chain of server
@throws IOException if connection failure occurs
@throws CancelledException if connection attempt is cancelled
Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/ServerConnectTask.java