myIsProxied = true;
    private void connect(ISVNSSLManager sslManager) throws IOException, SVNException {        SVNURL location = myRepository.getLocation();        if (mySocket == null || SVNSocketFactory.isSocketStale(mySocket)) {            myIsProxied = false;            myProxyAuthentication = null;            close();            String host = location.getHost();            int port = location.getPort();            ISVNAuthenticationManager authManager = myRepository.getAuthenticationManager();            ISVNProxyManager proxyAuth = authManager != null ? authManager.getProxyManager(location) : null;            if (proxyAuth != null && proxyAuth.getProxyHost() != null) {                mySocket = SVNSocketFactory.createPlainSocket(proxyAuth.getProxyHost(), proxyAuth.getProxyPort());                myProxyAuthentication = getProxyAuthString(proxyAuth.getProxyUserName(), proxyAuth.getProxyPassword());                if (myIsSecured) {                    HTTPRequest connectRequest = new HTTPRequest();                    connectRequest.setConnection(this);                    connectRequest.setProxyAuthentication(myProxyAuthentication);                    connectRequest.dispatch("CONNECT", host + ":" + port, null, 0, 0, null);                    HTTPStatus status = connectRequest.getStatus();                    if (status.getCode() == HttpURLConnection.HTTP_OK) {                        myInputStream = null;                        myOutputStream = null;                        mySocket = SVNSocketFactory.createSSLSocket(sslManager, host, port, mySocket);                        myIsProxied = true;                        proxyAuth.acknowledgeProxyContext(true, null);                        return;                    }                    SVNURL proxyURL = SVNURL.parseURIEncoded("http://" + proxyAuth.getProxyHost() + ":" + proxyAuth.getProxyPort());                     SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "'{0}' request failed on ''{1}''", new Object[] {"CONNECT", proxyURL});                    proxyAuth.acknowledgeProxyContext(true, err);                    SVNErrorManager.error(err, connectRequest.getErrorMessage());                }                proxyAuth.acknowledgeProxyContext(true, null);            } else {                mySocket = myIsSecured ? SVNSocketFactory.createSSLSocket(sslManager, host, port) : SVNSocketFactory.createPlainSocket(host, port);            }        }    }