static RemoteRepositoryServerHandle connect(ServerInfo server)
			throws LoginException, GeneralSecurityException, IOException, CancelledException {

		getClientAuthenticator();
		boolean allowLoginRetry = (clientAuthenticator instanceof DefaultClientAuthenticator);

		RemoteRepositoryServerHandle hdl = null;
		ServerConnectTask connectTask = new ServerConnectTask(server, allowLoginRetry);
		if (SystemUtilities.isInHeadlessMode()) {
			connectTask.run(TaskMonitor.DUMMY); // headless - can't cancel
		}
		else {
			// Must be done in modal dialog to allow cancellation and possible authentication prompts
			// from another thread.
			TaskLauncher.launch(connectTask);
			if (connectTask.isCancelled()) {
				throw new CancelledException();
			}
		}

		hdl = connectTask.getRepositoryServerHandle();
		if (hdl == null) {
			Exception e = connectTask.getException();
			if (e == null) {
				return null; // cancelled by user
			}
			if (e instanceof IOException) {
				throw (IOException) e;
			}
			if (e instanceof LoginException) {
				throw (LoginException) e;
			}
			if (e instanceof GeneralSecurityException) {
				throw (GeneralSecurityException) e;
			}
			if (e instanceof RuntimeException) {
				throw (RuntimeException) e;
			}
			throw new AssertException(e);
		}
		return hdl;
	}
Connect to a Repository Server and obtain a handle to it.
Based upon the server authentication requirements, the user may be
prompted for a name/password via a Swing dialog.  If null
is returned, this indicates that the user cancelled the connect
operation.
@param server server address and port
@return repository server handle
@throws LoginException thrown if server fails to authenticate user or
general access is denied.
@throws GeneralSecurityException if server authentication fails due to
credential access error (e.g., PKI cert failure)
@throws IOException thrown if an IO Error occurs.
@throws CancelledException if connection cancelled by user (does not apply to Headless use)
Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/ClientUtil.java