Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-683

SSL with Client- and Servercertificates not working

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Won't Fix
    • 3.0.1
    • None
    • None

    Description

      I informed about this bug already some releases before but at least in the 3.01 release it is still not resolved. Here it is again: SSL with the contrib package with Client- and Servercertificates is not working and throws an Exception, I don't remember which one. This is due to a bug in the HttpClient class. I patched the code as following:

      public int executeMethod(HostConfiguration hostconfig,
      final HttpMethod method, final HttpState state)
      throws IOException, HttpException {

      LOG.trace("enter HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState)");

      if (method == null)

      { throw new IllegalArgumentException("HttpMethod parameter may not be null"); }

      HostConfiguration defaulthostconfig = getHostConfiguration();
      if (hostconfig == null)

      { hostconfig = defaulthostconfig; }

      URI uri = method.getURI();
      if (hostconfig == defaulthostconfig || uri.isAbsoluteURI()) {
      // make a deep copy of the host defaults
      hostconfig = new HostConfiguration(hostconfig);
      if (hostconfig.getHost() == null && uri.isAbsoluteURI())

      { hostconfig.setHost(uri); }

      }

      HttpMethodDirector methodDirector = new HttpMethodDirector(
      getHttpConnectionManager(),
      hostconfig,
      this.params,
      (state == null ? getState() : state));
      methodDirector.executeMethod(method);
      return method.getStatusCode();
      }

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            wow Wolfgang Winter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment