if (proxyAuth != null && proxyAuth.getProxyHost() != null) { mySocket = SVNSocketFactory.createPlainSocket(proxyAuth.getProxyHost(), proxyAuth.getProxyPort()); if (myProxyAuthentication == null) { myProxyAuthentication = new HTTPBasicAuthentication(proxyAuth.getProxyUserName(), proxyAuth.getProxyPassword()); myOutputStream = null; mySocket = SVNSocketFactory.createSSLSocket(sslManager, host, port, mySocket); 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(false, err); SVNErrorManager.error(err, connectRequest.getErrorMessage());
private SVNRepository setupRepo(String _path) throws RepoMismatchException { // Set repository for given URL (+ trunk or tag suffix) String tmp = null; // Build repository URL (incl. path) if(_path==null) tmp = this.url.toString(); else tmp = this.url.toString() + (this.url.toString().endsWith("/") ? "" : "/") + _path; SVNRepository repo = null; try { SVNURL url = SVNURL.parseURIEncoded(tmp); //SVN2Client.log.debug("Environment proxy (host:port): " + System.getProperty("http.proxyHost") + ":" + System.getProperty("http.proxyPort")); SvnClient.log.info("SVNKIT proxy configuration (host:port): " + authManager.getProxyManager(url).getProxyHost() + ":" + authManager.getProxyManager(url).getProxyPort()); repo = SVNRepositoryFactory.create(url); repo.setAuthenticationManager(authManager); repo.testConnection(); } catch(SVNException e) { e.printStackTrace(); throw new RepoMismatchException(this, tmp, e); // "Cannot create SVN repository from URL '" + tmp + "': " + e.getMessage()); } return repo; }
ISVNProxyManager proxyManager = authManager != null ? authManager.getProxyManager(location) : null; if (proxyManager != null) { proxyManager.acknowledgeProxyContext(false, err); ISVNProxyManager proxyManager = authManager != null ? authManager.getProxyManager(location) : null; if (proxyManager != null) { proxyManager.acknowledgeProxyContext(true, null);
private char[] getProxyPasswordValue(ISVNProxyManager proxyManager) { if (proxyManager == null) { return null; } else if (proxyManager instanceof ISVNProxyManagerEx) { return ((ISVNProxyManagerEx) proxyManager).getProxyPasswordValue(); } else { final String password = proxyManager.getProxyPassword(); if (password == null) { return null; } return password.toCharArray(); } }
proxyManager.acknowledgeProxyContext(false, err); proxyManager.acknowledgeProxyContext(true, err); proxyManager.acknowledgeProxyContext(false, err); proxyManager.acknowledgeProxyContext(true, null);
readTimeout = DEFAULT_HTTP_TIMEOUT; if (proxyAuth != null && proxyAuth.getProxyHost() != null) { myRepository.getDebugLog().logFine(SVNLogType.NETWORK, "Using proxy " + proxyAuth.getProxyHost() + " (secured=" + myIsSecured + ")"); mySocket = SVNSocketFactory.createPlainSocket(proxyAuth.getProxyHost(), proxyAuth.getProxyPort(), connectTimeout, readTimeout, myRepository.getCanceller()); if (myProxyAuthentication == null) { myProxyAuthentication = new HTTPBasicAuthentication(proxyAuth.getProxyUserName(), proxyAuth.getProxyPassword(), myCharset); myOutputStream = null; mySocket = SVNSocketFactory.createSSLSocket(keyManager != null ? new KeyManager[] { keyManager } : new KeyManager[0], trustManager, host, port, mySocket, readTimeout); 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(false, err); SVNErrorManager.error(err, connectRequest.getErrorMessage(), SVNLogType.NETWORK);
ISVNProxyManager proxyManager = authManager != null ? authManager.getProxyManager(location) : null; if (proxyManager != null) { proxyManager.acknowledgeProxyContext(false, err); ISVNProxyManager proxyManager = authManager != null ? authManager.getProxyManager(location) : null; if (proxyManager != null) { proxyManager.acknowledgeProxyContext(true, null);
readTimeout = DEFAULT_HTTP_TIMEOUT; if (proxyAuth != null && proxyAuth.getProxyHost() != null) { myRepository.getDebugLog().logFine(SVNLogType.NETWORK, "Using proxy " + proxyAuth.getProxyHost() + " (secured=" + myIsSecured + ")"); mySocket = SVNSocketFactory.createPlainSocket(proxyAuth.getProxyHost(), proxyAuth.getProxyPort(), connectTimeout, readTimeout, myRepository.getCanceller()); if (myProxyAuthentication == null) { myProxyAuthentication = new HTTPBasicAuthentication(proxyAuth.getProxyUserName(), proxyAuth.getProxyPassword(), myCharset); myOutputStream = null; mySocket = SVNSocketFactory.createSSLSocket(keyManager != null ? new KeyManager[] { keyManager } : new KeyManager[0], trustManager, host, port, mySocket, readTimeout); 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(false, err); SVNErrorManager.error(err, connectRequest.getErrorMessage(), SVNLogType.NETWORK);
ISVNProxyManager proxyManager = authManager != null ? authManager.getProxyManager(location) : null; if (proxyManager != null) { proxyManager.acknowledgeProxyContext(false, err); ISVNProxyManager proxyManager = authManager != null ? authManager.getProxyManager(location) : null; if (proxyManager != null) { proxyManager.acknowledgeProxyContext(true, null);
if (proxyManager != null && proxyManager.getProxyHost() != null) { final ISVNDebugLog debugLog = myRepository.getDebugLog(); debugLog.logFine(SVNLogType.NETWORK, "Using proxy " + proxyManager.getProxyHost() + " (secured=" + myIsSecured + ")"); mySocket = SVNSocketFactory.createPlainSocket(proxyManager.getProxyHost(), proxyManager.getProxyPort(), connectTimeout, readTimeout, myRepository.getCanceller()); myIsProxied = true; if (myIsSecured) { while(true) { if (mySocket == null) { mySocket = SVNSocketFactory.createPlainSocket(proxyManager.getProxyHost(), proxyManager.getProxyPort(), connectTimeout, readTimeout, myRepository.getCanceller()); debugLog.logFine(SVNLogType.NETWORK, "proxy connection reopened"); myProxyAuthentication = null; mySocket = SVNSocketFactory.createSSLSocket(keyManager != null ? new KeyManager[] { keyManager } : new KeyManager[0], trustManager, host, port, mySocket, readTimeout); proxyManager.acknowledgeProxyContext(true, null); return; } else if (status.getCode() == HttpURLConnection.HTTP_PROXY_AUTH) { myProxyAuthentication.setCredentials(SVNPasswordAuthentication.newInstance(proxyManager.getProxyUserName(), getProxyPasswordValue(proxyManager), false, myRepository.getLocation(), false)); debugLog.logFine(SVNLogType.NETWORK, "explicit credentials set"); SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "HTTP proxy authorization failed"); if (proxyManager != null) { proxyManager.acknowledgeProxyContext(false, err); SVNURL proxyURL = SVNURL.parseURIEncoded("http://" + proxyManager.getProxyHost() + ":" + proxyManager.getProxyPort()); SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "{0} request failed on ''{1}''", new Object[] {"CONNECT", proxyURL}); proxyManager.acknowledgeProxyContext(false, err);