Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3957

Need http proxy support for Davex connection

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.12.1
    • Fix Version/s: None
    • Component/s: jackrabbit-spi2dav
    • Labels:
      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)

      { 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.

        Attachments

        1. RepositoryServiceImpl.java
          156 kB
          Kenichi Ando

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kenichia Kenichi Ando
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: