public void ensureConnection() throws AuthenticationException {
        BugLog.getInstance().assertNotNull(getConnection());

        if (getConnection().isOpen()) {
            return;
        }

        // #69689 detect silent servers, possibly caused by proxy errors
        final Throwable ex[] = new Throwable[1];
        final boolean opened[] = new boolean[] { false };
        final Runnable probe = new Runnable() {
            public void run() {
                try {
                    getConnection().open();
                    synchronized (opened) {
                        opened[0] = true;
                    }
                } catch (final Throwable e) {
                    synchronized (ex) {
                        ex[0] = e;
                    }
                }
            }
        };

        final Thread probeThread = new Thread(probe, "CVS Server Probe"); // NOI18N
        probeThread.start();
        try {

            probeThread.join(60 * 1000); // 1 min

            Throwable wasEx;
            synchronized (ex) {
                wasEx = ex[0];
            }
            if (wasEx != null) {
                if (wasEx instanceof CommandAbortedException) {
                    // User cancelled
                    abort();
                    return;
                } else if (wasEx instanceof AuthenticationException) {
                    throw (AuthenticationException) wasEx;
                } else if (wasEx instanceof RuntimeException) {
                    throw (RuntimeException) wasEx;
                } else if (wasEx instanceof Error) {
                    throw (Error) wasEx;
                } else {
                    assert false : wasEx;
                }
            }

            boolean wasOpened;
            synchronized (opened) {
                wasOpened = opened[0];
            }
            if (wasOpened == false) {
                probeThread.interrupt();
                throw new AuthenticationException("Timeout, no response from server.",
                                "Timeout, no response from server.");
            }

        } catch (final InterruptedException e) {

            // User cancelled
            probeThread.interrupt();
            abort();
        }
    }