You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Kenichi Ando (JIRA)" <ji...@apache.org> on 2016/04/03 17:34:25 UTC

[jira] [Created] (JCR-3957) Need http proxy support for Davex connection

Kenichi Ando created JCR-3957:
---------------------------------

             Summary: Need http proxy support for Davex connection
                 Key: JCR-3957
                 URL: https://issues.apache.org/jira/browse/JCR-3957
             Project: Jackrabbit Content Repository
          Issue Type: Improvement
          Components: jackrabbit-spi2dav
    Affects Versions: 2.12.1
            Reporter: Kenichi Ando


This is an enhancement request for Jackrabbit JCR connection. The current Jackrabbit implementation does not support http proxy. This would be a problem for customers whose network requires proxy configurations.

JVM has some system properties related to proxy configurations, such as http.proxyHost, http.proxyPort and java.net.useSystemProxies. However, these properties don’t work, because the jackrabbit implementation depends on Apache HttpClient 3.x, which ignores them.
 
The way to support proxy is described in the following url.
http://aem-authentication.blogspot.jp/p/new-jcr-api-for-remote-connection.html

According to this blog, it's not difficult to change the code to support proxy. 

Actually, when I modify org.apache.jackrabbit.spi2dav.RepositoryServiceImpl to call hostConfig.setProxy(), the client program can connect to the repository via proxy server. 
~~~~~~~~~~~~~~~
[line#337]
			//set proxy host
			String proxyHost = System.getProperty("http.proxyHost");
			int proxyPort = Integer.valueOf(System.getProperty("http.proxyPort"));
			if (proxyHost != null) {
				System.out.println("[setProxy] " + proxyHost + ":" + proxyPort);
				hostConfig.setProxy(proxyHost, proxyPort);
			}
~~~~~~~~~~~~~~~
[line#554]
			// set proxy credentials
			String proxyHost = System.getProperty("http.proxyHost");
			int proxyPort = Integer.valueOf(System.getProperty("http.proxyPort"));
			String proxyUser = System.getProperty("http.proxyUser");
			String proxyPassword = System.getProperty("http.proxyPassword");
			
			if (proxyHost != null && proxyUser != null) {
				System.out.println("[setProxyCredentials] " + proxyUser + "/" + proxyPassword);
				client.getState().setProxyCredentials(
								new AuthScope(proxyHost, proxyPort),
								new UsernamePasswordCredentials(proxyUser, proxyPassword));
			}
~~~~~~~~~~~~~~~
Please find the code I modified in attachment.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)