Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.12.1
-
None
-
None
Description
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)
~~~~~~~~~~~~~~~
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.