From patchwork Tue May 23 05:53:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Donnellan X-Patchwork-Id: 765763 X-Patchwork-Delegate: ruscur@russell.cc Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wX4Vf61lhz9sP5 for ; Tue, 23 May 2017 15:54:50 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wX4Vf58kjzDqZk for ; Tue, 23 May 2017 15:54:50 +1000 (AEST) X-Original-To: snowpatch@lists.ozlabs.org Delivered-To: snowpatch@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wX4VY0jxpzDqKy for ; Tue, 23 May 2017 15:54:44 +1000 (AEST) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4N5n5tr054747 for ; Tue, 23 May 2017 01:54:41 -0400 Received: from e23smtp02.au.ibm.com (e23smtp02.au.ibm.com [202.81.31.144]) by mx0a-001b2d01.pphosted.com with ESMTP id 2am9y6bkh1-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 23 May 2017 01:54:41 -0400 Received: from localhost by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 May 2017 15:54:38 +1000 Received: from d23relay06.au.ibm.com (202.81.31.225) by e23smtp02.au.ibm.com (202.81.31.208) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 23 May 2017 15:54:36 +1000 Received: from d23av05.au.ibm.com (d23av05.au.ibm.com [9.190.234.119]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4N5sR2b53149888 for ; Tue, 23 May 2017 15:54:35 +1000 Received: from d23av05.au.ibm.com (localhost [127.0.0.1]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v4N5s3Jq021191 for ; Tue, 23 May 2017 15:54:03 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v4N5s2WS020530 for ; Tue, 23 May 2017 15:54:03 +1000 Received: from ajd.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 31D94A0196 for ; Tue, 23 May 2017 15:53:38 +1000 (AEST) From: Andrew Donnellan To: snowpatch@lists.ozlabs.org Date: Tue, 23 May 2017 15:53:33 +1000 X-Mailer: git-send-email 2.11.0 X-TM-AS-MML: disable x-cbid: 17052305-0004-0000-0000-00000205D7ED X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17052305-0005-0000-0000-000009FB6B7D Message-Id: <20170523055333.12435-1-andrew.donnellan@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-23_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705230030 Subject: [snowpatch] [PATCH] main: Use SSL connector for non-proxied connections X-BeenThere: snowpatch@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Continuous Integration for patch-based workflows List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: snowpatch-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "snowpatch" We currently create an HttpsConnector so we can use HTTPS with hyper, but we only actually use it in the case where an HTTP proxy is used. Fix the non-proxy case so the hyper client uses the HttpsConnector. Signed-off-by: Andrew Donnellan --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index a0e6576..9b24385 100644 --- a/src/main.rs +++ b/src/main.rs @@ -263,9 +263,9 @@ fn main() { let settings = settings::parse(&args.arg_config_file); // The HTTP client we'll use to access the APIs - // TODO: HTTPS support, not yet implemented in Hyper as of 0.9.6 let ssl = OpensslClient::new().unwrap(); let connector = HttpsConnector::new(ssl.clone()); + // TODO: Handle https_proxy let client = Arc::new(match env::var("http_proxy") { Ok(proxy_url) => { debug!("snowpatch is using HTTP proxy {}", proxy_url); @@ -286,7 +286,7 @@ fn main() { }, _ => { debug!("snowpatch starting without a HTTP proxy"); - let mut c = Client::new(); + let mut c = Client::with_connector(connector); c.set_redirect_policy(RedirectPolicy::FollowAll); c }