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

Read timeout not applied for SSLHandshake when using proxy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 4.5.12
    • None
    • HttpClient (classic)
    • None

    Description

      When I make a connection to an https endpoint without proxy I've confirmed that read timeouts as specified in the RequestConfig part of the client are applied by putting a breakpoint against the startHandshake line in SSLConnectionSocketFactory:394 (I viewed the expression sslsock.getSoTimeout()).

      However, when I make a connection to an https endpoint (e.g. https://google.com) via our corporate proxy I can see via the same breakpoint that sslsock.getSoTimeout() returns 0.

      Here's the test code that when debugged showed the problem:

      {{RequestConfig requestConfig = RequestConfig
      .custom()
      .setConnectionRequestTimeout(10000)
      .setConnectTimeout(10000)
      .setSocketTimeout(5000)
      .build();
      HttpClient client = HttpClientBuilder
      .create()
      .setDefaultRequestConfig(requestConfig)
      .setProxy(HttpHost.create("http://proxy:8080")) //
      .build();
      HttpGet get = new HttpGet("https://google.com");
      client.execute(get);}}

      By the way the consequence of this has been hangs in our production environment talking to Microsoft's EWS service which seemed to be flaky last week.

      I have a workaround described by Li Changshu in HTTPCLIENT-1478 involving setting a pooling connection manager but I would like the library to behave consistently when using a proxy.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              davidmoten2 Dave Moten
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m