Return-Path: X-Original-To: apmail-hc-httpclient-users-archive@www.apache.org Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5A8FF19771 for ; Fri, 25 Mar 2016 03:57:08 +0000 (UTC) Received: (qmail 87185 invoked by uid 500); 25 Mar 2016 03:57:08 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 87145 invoked by uid 500); 25 Mar 2016 03:57:08 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 87133 invoked by uid 99); 25 Mar 2016 03:57:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Mar 2016 03:57:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 533E8C2F3B for ; Fri, 25 Mar 2016 03:57:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.825 X-Spam-Level: ** X-Spam-Status: No, score=2.825 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HK_RANDOM_ENVFROM=0.626, HK_RANDOM_FROM=1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, WEIRD_PORT=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id rvQdSGUzrB-r for ; Fri, 25 Mar 2016 03:57:06 +0000 (UTC) Received: from mail-ob0-f175.google.com (mail-ob0-f175.google.com [209.85.214.175]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id F22D05F398 for ; Fri, 25 Mar 2016 03:57:05 +0000 (UTC) Received: by mail-ob0-f175.google.com with SMTP id m7so51699449obh.3 for ; Thu, 24 Mar 2016 20:57:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=NIbEVXHVYddH90zc0A86uZeZAf058KQfYR4o7ITneR0=; b=xp2TmYkY9NSfXoEzqIgNFEAwOYdbE5mTo2s9+220a79W/j+8sijViHXfAyjWt0l4HE gofCXiQpNDgBSOO1p6Vaz+vSzZ9xbtA8Q2pVrAejmKVT16YC7oyZgY42dJbC9oSs0CUK 4/Xn59i7dKcIIQtnDb9xBccO+lLkZQoeJu1uWdjoD2C87eyD5iPgQ7Jxpz1LKbg1+5KA 5rOGzr2K5XQq8Zct16a6SyIkaEbHyRpKEQlVox37CDibxHItPrP/i4X3q94AEmufKKE+ llsrX5hiF8c7h97Bxgw4FHwEn8qC3dlwvI6Mx7KQ7S1+gCPlHuM7bAex0bY50PuWCnoA FlGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=NIbEVXHVYddH90zc0A86uZeZAf058KQfYR4o7ITneR0=; b=awRUqtEgN82ygxtFDSBnZgBPDyAZaiCJQjTrM9QidcEMiHoKE7tuWiu0nftS9kaQMV 37Rpc1YAEQy5cQClQISzVget8s1kTSJ1rKohJSPotIqrXnlGTmhNVkEMJif2hBT3iSrn bWER4Q0GUkN9lBEchpA78MtPa8LBqlFP2iTWBV1or21FkRG+aPZixoj60wkLxAixKxsr E0kkonG8N/z4OcRDY/yjFvoS2hO7km7MAvSrYK+Gzo/NSymbT+5qyvgtM8ZurDvSHblE p70h8e9cTNUw43cWHVsQlBkUItEFWWRS0BbK04HrGIV4DUX+49VT3DMDHpgtGzChbZXU xdoQ== X-Gm-Message-State: AD7BkJKhB7IlAF56qhd1aPQHX2p4JkzimmYzgmoxIDbThl1KScAZ/WDE4cbdWQnaA6cWZPX1S79KEiyPFbs1+A== MIME-Version: 1.0 X-Received: by 10.60.82.10 with SMTP id e10mr6361295oey.0.1458878219231; Thu, 24 Mar 2016 20:56:59 -0700 (PDT) Received: by 10.157.15.225 with HTTP; Thu, 24 Mar 2016 20:56:59 -0700 (PDT) Date: Thu, 24 Mar 2016 23:56:59 -0400 Message-ID: Subject: Bizarre issue with CloseableHttpClient , every other httpget works From: Heather Carter To: httpclient-users@hc.apache.org Content-Type: multipart/alternative; boundary=047d7b6767ca072907052ed78eb3 --047d7b6767ca072907052ed78eb3 Content-Type: text/plain; charset=UTF-8 I have a program that goes out and gets a file from a https site, which for now I have simulated with a method on my service since the real site isn't ready. The simulating method that returns a file with lines to process (it reads a file from a local resource dir and streams it out): https://mymachine:8443/myapp/contentsim/file1 The method that will make the HttpGet call to the simulator to get the file and do the work https://mymachine:8443/myapp/processfile/file1 I had to put in a timeout in my code so that I move past an issue where the calls were hanging. It now will successfully make the SSL handshake every other time. HttpGet get = null; RequestConfig params = RequestConfig.custom().setConnectTimeout(5000).setSocketTimeout(5000).build(); String docRetrievalUrl = " https://mymachine:8443/myapp/contentsim/file1"; get = new HttpGet(docRetrievalUrl); get.setConfig(params); LOGGER.info(">>> getDoc{}"); //sslClientFactory sets up keystore and truststore and trustmanagers & keymanagers //for 2 way ssl try (CloseableHttpClient httpClient = this.sslClientFactory.getHttpClient(); CloseableHttpResponse response = httpClient.execute(get) ){ if (response !=null) { LOGGER.debug("Begin"); HttpEntity entity = response.getEntity(); if (entity !=null) { InputStream is = entity.getContent(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); LOGGER.error("Beggining to process content as csv"); try ( CSVReader csvReader = new CSVReader(br,',','"') ) { String[] cells; while ( (cells = csvReader.readNext()) != null ){ csvLines.add( new DataRow(cells) ); } } br.close(); } LOGGER.debug("done"); } } catch (IOException ex) { LOGGER("Problem " + ex.getMessage(),ex); } --047d7b6767ca072907052ed78eb3--